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 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.
Thank you Vaishnavi Joshi it worked
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,
If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much
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
What's the problem?
André Arnaud de Cal... 291,883 Super User 2024 Season 2
Martin Dráb 230,569 Most Valuable Professional
nmaenpaa 101,156