Hello everyone,
At present, the JOB QUEUE of automatic posting OUTPUT JOURNAL has been added.
but only post Item Journal Batches="MAKD".
If I want to automatically post Item Journal Batches="0086",
how can I write it in AL CODE? Thank you!
Hello everyone,
At present, the JOB QUEUE of automatic posting OUTPUT JOURNAL has been added.
but only post Item Journal Batches="MAKD".
If I want to automatically post Item Journal Batches="0086",
how can I write it in AL CODE? Thank you!
Ok,
For sake of idea you can use as per something below
PaymentJournal.Init();
PaymentJournal."Journal Template Name" := Rec."Pmt Jnl Template Name";
PaymentJournal."Journal Batch Name" := Rec."Pmt Jnl Batch Name";
PaymentJournal."Line No." := LineNO;
EVALUATE(PaymentJournal."Posting Date", GetValueAtCell(RowNo, 1));
EVALUATE(PaymentJournal."Document Type", GetValueAtCell(RowNo, 2));
EVALUATE(PaymentJournal."Document No.", GetValueAtCell(RowNo, 3));
EVALUATE(PaymentJournal."External Document No.", GetValueAtCell(RowNo, 4));
EVALUATE(PaymentJournal."Account Type", GetValueAtCell(RowNo, 5));
EVALUATE(PaymentJournal."Account No.", GetValueAtCell(RowNo, 6));
EVALUATE(PaymentJournal."Description", GetValueAtCell(RowNo, 7));
Evaluate(PaymentJournal."Amount (LCY)", GetValueAtCell(RowNo, 8));
Evaluate(PaymentJournal."Bal. Account Type", GetValueAtCell(RowNo, 9));
Evaluate(PaymentJournal."Bal. Account No.", GetValueAtCell(RowNo, 10));
PaymentJournal.Validate("Amount (LCY)");
PaymentJournal.Insert();
Thank you!
But I want to know how to write in AL CODE, I am not so familiar with AL CODE
Go with the same job queue through Code, and pass the same Item journal batch and Template name, it will start posting data from the same batch you are looking for.
You have to filter the Item Journal with Template and batch with the values you need, Pass the Item Journal to the posting codeunit.
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156