web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: post a data from purchase journal to vendor ledger entries and general ledger entries.

    What's the problem?

  • Pooja Zinjurke Profile Picture
    45 on at
    RE: post a data from purchase journal to vendor ledger entries and general ledger entries.

    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,062 on at
    RE: post a data from purchase journal to vendor ledger entries and general ledger entries.

    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
    RE: post a data from purchase journal to vendor ledger entries and general ledger entries.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,791

#2
YUN ZHU Profile Picture

YUN ZHU 2,091 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 2,090

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans