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

New Procedure in Standard Event (Code Unit)

(0) ShareShare
ReportReport
Posted on by 295
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;
I have the same question (0)
  • Mohana Yadav Profile Picture
    60,977 Super User 2025 Season 2 on at
    New Procedure in Standard Event (Code Unit)
    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,239 Super User 2025 Season 2 on at
    New Procedure in Standard Event (Code Unit)
    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
    295 on at
    New Procedure in Standard Event (Code Unit)
    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
    295 on at
    New Procedure in Standard Event (Code Unit)
    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

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
Sumit Singh Profile Picture

Sumit Singh 2,179

#2
OussamaSabbouh Profile Picture

OussamaSabbouh 1,999

#3
YUN ZHU Profile Picture

YUN ZHU 1,892 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans