There is nothing to post while posting Item Journal Line

Dear All,
I am trying to adjust the item quantity programatically via item journal line. But I am facing an error There is nothing to post. This is my code
ModifiedTime := FORMAT("Modified On");
Pos := STRPOS(ModifiedTime,' ');

ItemJournalLine."Document No." := Item."No." + ' ' + DELSTR(ModifiedTime, 1, Pos);
ItemJournalLine."Journal Template Name" := IntegrationSetup."Journal Template Name";
ItemJournalLine."Journal Batch Name" := IntegrationSetup."Journal Batch Name";
ItemJournalLine."Posting Date" := TODAY; 
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::Purchase;
ItemJournalLine."Item No." := Item."No.";
ItemJournalLine.Quantity := Inventory;
ItemJournalLine."Quantity (Base)" := Inventory;
ItemJournalLine."Gen. Prod. Posting Group" := Item."Gen. Prod. Posting Group";
ItemJournalLine."Gen. Bus. Posting Group" := IntegrationSetup."Gen. Bus. Posting Group";
CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post",ItemJournalLine);

Please tell me how to fix this error. THanks
Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.

please like / agree / verify my answer, if it was helpful for you. thanks.

Best Answer


Sign In or Register to comment.