The call happens from a custom table (Carrier Bill of Lading) that acts as a header for Sales Shipment Lines from multiple Sales Shipment Headers. I have added a field on the Sales Shipment Line table that is the key field for this table (Carrier Bill of Lading).
Here is the full code from “Carrier Bill of Lading”.PrintPaperWork
GetSalesShipmentHeaders;
IF SSHdr.FINDSET THEN BEGIN
REPEAT
SSHdr.SETRANGE(“No.”,SSHdr.“No.”);
REPORT.RUN(50044,FALSE,TRUE,SSHdr);
SSHdr.SETRANGE(“No.”);
UNTIL SSHdr.NEXT = 0;
END;
The function GetSalesShipmentHeaders creates a list in SSHdr of all Sales Shipment Header records that are referenced in Sales Shipment Lines that have the same value as the Key field in the current table.