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...
Answered

New Procedure in Standard Event (Code Unit)

(0) ShareShare
ReportReport
Posted on by 307
I wrote a code unit but I wonder whether my code overrides 3rd Vendor or standards event code
 
Or my code will works independently ?
 
  [EventSubscriber(ObjectType::Table, database::/Vendor Ledger Entry/, 'OnAfterCopyVendLedgerEntryFromGenJnlLine', '', true, true)]
    procedure TLC_InsertVendLed(VAR VendorLedgerEntry: Record /Vendor Ledger Entry/; GenJournalLine: Record /Gen. Journal Line/)
    var
    begin
        IF GenJournalLine./TLC Employee Code/ <> '' THEN
            VendorLedgerEntry./TLC Employee Code/ := GenJournalLine./TLC Employee Code/;
    end;
    [EventSubscriber(ObjectType::Table, Database::/Vendor Ledger Entry/, 'OnAfterCopyVendLedgerEntryFromCVLedgEntryBuffer', '', true, true)]
    local procedure TLC_OnAfterCopyVendLedgerEntryFromCVLedgEntryBuffer(var VendorLedgerEntry: Record /Vendor Ledger Entry/; CVLedgerEntryBuffer: Record /CV Ledger Entry Buffer/)
    begin
        if CVLedgerEntryBuffer./TLC Employee Code/ <> '' then
            VendorLedgerEntry./TLC Employee Code/ := CVLedgerEntryBuffer./TLC Employee Code/;
    end;
    [EventSubscriber(ObjectType::Table, Database::/Vendor Ledger Entry/, 'OnAfterCopyVendLedgerEntryFromGenJnlLine', '', true, true)]
    local procedure TLC_OnAfterCopyVendLedgerEntryFromGenJnlLine(var VendorLedgerEntry: Record /Vendor Ledger Entry/; GenJournalLine: Record /Gen. Journal Line/)
    begin
        if GenJournalLine./TLC Employee Code/ <> '' then
            VendorLedgerEntry./TLC Employee Code/ := GenJournalLine./TLC Employee Code/;
    end;
  • Mohana Yadav Profile Picture
    61,252 Super User 2026 Season 2 on at
    What do you mean by "overrides 3rd Vendor or standards event code?
     
    Can you please explain?
  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at
    Your code will not overwrite. You code is an addition to the standard or any other app that subscribe to the same event.
    Unless there are other app that is working on TLC Employee Code, it is safe to assume that your code will not overwrite other code.
  • Verified answer
    Hoang Ng Profile Picture
    307 on at
    Thanks Teddy.
     
    From your explanation, I understand all the codes will go parallel
    I must only be carefully if I modify same Field as Standard or 3rd 's one.
     
    Hi Yadav,
     
    I means whether my code will work then standard code or 3rd code will stop if I use same event.
  • Hoang Ng Profile Picture
    307 on at
    Until now, I would like to update there is no problem with above code

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 727 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 512 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 321 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans