Hi Rimmon,
Thanks for the quick reply!
The code was to select all of the lines for the headers that had previously been selected, and I was attempting to build the following statement;
ForAll(RenameColumns(collAppHdr, "crf5f_sihidkey", "hID"),
Collect(collApprovals, Filter(SupplierInvoiceLines, SupplierInvoiceHeader.SIHIDKey="hID))
with the intention of then adding columns to bring in some additional values from the related header record.
However, I decided to changetack and removed the ForAll around the collect and I was able to successfully use the following code;
ClearCollect(collApprovals, AddColumns(Filter(SupplierInvoiceLines, SupplierInvoiceHeader.SIHIDKey in Distinct(collAppHDR, SIHIDKey)), "INVDisplayNotes", "N",
"INVDeliveryContact", Project.PRAssignedto,
"INVSalesContact", Project.PRSalesContact,
"SIHReference", SupplierInvoiceHeader.SIHReference,
"SIHPayTech", SupplierInvoiceHeader.BKPartner.TDSearchCode,
"SIHStatus", SupplierInvoiceHeader.SIHStatus,
"SIHDescription", SupplierInvoiceHeader.SIHDescription,
"PO_IDs", PurchaseOrder.POIDKey));