I made a Purchase Order from a Sales Order (Actions → Create Purchase Document → Create Purchase orders) and now I want the “Quantity Received” and “Quantity Invoiced” fields belonging to Purchase Line to appear in Sales Line.
I made an extension of the table “Sales Line”, in which I try to create such fields using “CalcFormula = Lookup …”
Sorry, no programming advice, but rather a way to accomplish your goal without programming.
Using the process you used (Actions > Create Purchase Document > Create Purchase Orders) to create the Purchase Orders will not link the two documents. If you set the Sales Line with a Purchasing Code of Drop Ship or Special Order, when the system creates the Purchase Document it will link the two documents.
The Special Order and Drop Ship process flow is different than the above, so you’ll want to review the process to ensure it still meets your needs. Both can be found in the Req. Worksheet.
When using this process you will have a link between the Sales and Purchase Documents. If using Drop Shipment you will also have a link between the Purchase Receipt and the Sales Shipment, as the package will never enter your facility.
I would encourage reaching out to your partner to step through the process and make sure it meets your needs.