Hi,
I have a small customisation to populate a few custom fields on PO505000 that works but I have a question on whether this is the most efficient way to achieve the outcome (from a database perspective).
The custom fields are highlighted below:

Trans Desc is the TransDesc field from SOLine
Description and Reference are the OrderDesc and CustomerRefNbr fields from SOOrder
The code in place to achieve this is shown below:

My question is this:
After the Unwrap statements on lines 41 and 42, the soOrder and SoLine objects are populated with sum data but no others. How is this controlled?
At line 43 the 3 fields I’m wanting to source are null. So, as a work around I am explicitly querying the database to retrieve all the SOLine and SOOrder. This results in a lot of additional queries, and this is what I’m looking to avoid.
The DAC extension I’m using is:

Thanks in advance for any advice,
John