web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

post a data from purchase journal to vendor ledger entries and general ledger entries.

(0) ShareShare
ReportReport
Posted on by 45

I have created one field in purchase journal which is Vendor order no, whenever insert any no in Vendor Order No and after clicked on Post i want data to be inserted in  vendor ledger entries and general ledger entries.

  • KTA Profile Picture
    1,200 on at

    What's the problem?

  • Pooja Zinjurke Profile Picture
    45 on at

    I am not able to post the vendor order no  through Purchase Journal in  vendor ledger entries and general ledger entries, can you please suggest how to write code for that through Post Button

  • Suggested answer
    Vaishnavi J Profile Picture
    3,096 on at

    Hi,

    Create a code unit object and use event subscriber and write the below logic.

       [EventSubscriber(ObjectType::Table, Database::"G/L Entry", 'OnAfterCopyGLEntryFromGenJnlLine', '', false, false)]

       local procedure OnAfterCopyGLEntryFromGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; var GLEntry: Record "G/L Entry")

       begin

           GLEntry.Validate(VendorOrderNo, GenJournalLine.VendorOrderNo);

       end;

       [EventSubscriber(ObjectType::Table, Database::"Vendor Ledger Entry", 'OnAfterCopyVendLedgerEntryFromGenJnlLine', '', false, false)]

       local procedure OnAfterCopyVendLedgerEntryFromGenJnlLine(GenJournalLine: Record "Gen. Journal Line"; var VendorLedgerEntry: Record "Vendor Ledger Entry")

       begin

           VendorLedgerEntry.Validate((VendorOrderNo, GenJournalLine.VendorOrderNo);

       end;

    please note you have to add permission on Codeunit object.

     Permissions = tabledata "Cust. Ledger Entry" = RIMD,

                            tabledata "Vendor Ledger Entry" = RIMD;

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • Pooja Zinjurke Profile Picture
    45 on at

    Thank you Vaishnavi Joshi it worked

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 728 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 545 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 328 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans