Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to automatically post one of the Item Journal Batches?

(0) ShareShare
ReportReport
Posted on by 40

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!

pastedimage1675390052734v2.png

pastedimage1675390015019v1.png

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: How to automatically post one of the Item Journal Batches?

    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();

  • Hsuan Hung Profile Picture
    Hsuan Hung 40 on at
    RE: How to automatically post one of the Item Journal Batches?

    Thank you!

    But I want to know how to write in AL CODE, I am not so familiar with AL CODE

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: How to automatically post one of the Item Journal Batches?

    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.

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 60,054 Super User 2024 Season 2 on at
    RE: How to automatically post one of the Item Journal Batches?

    You have to filter the Item Journal with Template and batch with the values you need, Pass the Item Journal to the posting codeunit.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans