WITH ItemJnlLine DO BEGIN ItemLedgEntry.INIT; ItemLedgEntry."Entry No." := ItemLedgEntryNo; ItemLedgEntry."Item No." := "Item No."; ItemLedgEntry."Posting Date" := "Posting Date"; ItemLedgEntry."Document Date" := "Document Date"; ItemLedgEntry."Entry Type" := "Entry Type"; ItemLedgEntry."Source No." := "Source No."; ItemLedgEntry."Document No." := "Document No."; ItemLedgEntry."Document Type" := "Document Type"; //>> New Code IF "Document Type" = "Document Type"::"Sales Shipment" THEN AddOrderInformation(ItemLedgEntry); //<< New Code ItemLedgEntry."Document Line No." := "Document Line No.";
Comments
You must pass ItemLedgEntry by reference to AddOrderInformation.
Regards.
Dynamics NAV Developer since 2005
I would have taken a different approach. That is to push the required data to the Item Journal Lines before calling CU 22. You will see this in CU 80 and 90.