ItemLedgerEntry.SETFILTER("Location Code", 'EXIT_INVENTORY'); ItemLedgerEntry.SETFILTER(Open, 'Ja'); IF ItemLedgerEntry.FIND('-') THEN REPEAT ZL += 10000; ItemJournalLine.INIT; ItemJournalLine."Journal Template Name" := 'ITEM'; ItemJournalLine."Journal Batch Name" := 'BOOK_OUT'; ItemJournalLine."Line No." := ZL; ItemJournalLine.INSERT; ItemJournalLine."Document No." := 'DocNo'; ItemJournalLine.VALIDATE("Posting Date",ItemLedgerEntry."Posting Date"); ItemJournalLine.VALIDATE("Entry Type",ItemLedgerEntry."Entry Type"); ItemJournalLine.VALIDATE("Item No.",ItemLedgerEntry."Item No."); ItemJournalLine.VALIDATE("Location Code",'EXIT_INVENTORY'); ItemJournalLine.VALIDATE("Variant Code",ItemLedgerEntry."Variant Code"); ItemJournalLine.VALIDATE("Entry Type",3); ItemJournalLine.VALIDATE(Quantity,ItemLedgerEntry."Quantity (Base)"); ItemJournalLine.VALIDATE("Quantity (Base)",ItemLedgerEntry."Quantity (Base)"); ItemJournalLine.VALIDATE("Applies-to Entry",ItemLedgerEntry."Entry No."); ItemJournalLine.MODIFY; UNTIL ItemLedgerEntry.NEXT=0;:shock:
Comments
Yes, i have try to intend this, only filling quantity, but doesn't work. Quantity(base) believes 0. And seems that Navision don't check it before booking the lines.
So you should get an error when you validate quantity field.
The code onvalidate of quantity field is
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n