Where are the Item Ledger entries created

CaponeCapone Member Posts: 125
Hi experts!

Our customer wants to have the order date and order no on every item ledger entry that is of type Sale and Document Type Shipment.
I have managed to get this for the most item ledger entries but somehow some of the ledger entries are created from another place.

I have added following code in function InitItemLedgerEntry in CU 22.
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.";

They are running 2009 have done all their shipment posting from the order but will from today do their posting from picking documents.
So the question is, are the item ledger entries created from another function in another case?
Hello IT, have you tried to turn it off and on?
Have you checked the cables?
Have you released the filters?

http://www.navfreak.com

Comments

  • Cem_KaraerCem_Karaer Member Posts: 281
    Hello,

    You must pass ItemLedgEntry by reference to AddOrderInformation.

    Regards.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
  • bbrownbbrown Member Posts: 3,268
    CU 22 is the only place where Item Ledger Entries are (should be) created.

    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.
    There are no bugs - only undocumented features.
Sign In or Register to comment.