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.

I have the same question (0)
  • 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,094 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,905 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 668 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans