web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Transferring custom fields form Gen. Journal Line to General Ledger Entries, Custom Ledger Entries and Vendor Ledger Entries

(0) ShareShare
ReportReport
Posted on by 241

Hi Experts,

I hope you all are doing well.

There is a custom field, Field Name "Narration" and Field Id 50000 in Table "Gen. Journal Line' (81). After posting a Gen Journal Line, values flow into different Ledger Entries depending upon the Account Type.  

In the case of sales invoices, when we define a new custom field in the sales header, we also define a new custom field with the same name. same data type and same id in the sales invoice header. And after posting a sales invoice that custom field automatically flows to the posted sales invoice. 

In BC 2021 Release Wave 2, I'm trying to post a General Journal but that new custom field is not flowing into respective ledger entries. For example, In Gen Journal Line the  "Account Type" is 'G/L Account' and "Bal Account Type" is also 'G/L Account' and after posting a General Journal, that new custom field doesn't automatically flow to General Ledger Entries. And similarly, that new custom field is not flowing to other ledger entries like customer ledger entries, vendor ledger entries, bank ledger entries, etc. 

This functionality is working fine in NAV 2017. but not working in BC 190. Can anyone please tell me how to resolve this issue,

Answers will be highly appreciated.

Thanks for reading.

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    You have to use OnAfterInitGLEntry event of Codeunit "Gen. Jnl.-Post Line" to flow the fields

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Maybe you can also look into using an additional dimension instead of a custom field, then you will not have to do any customization to get the extra info to the ledgers.

  • Verified answer
    YUN ZHU Profile Picture
    95,681 Super User 2025 Season 2 on at

    Hi, Some fields are not transferred automatically, so as Mohana mentioned, you need to investigate the event. Then you need to add Code as Subscription in Codeunit.

    More details: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-subscribing-to-events

    Hope this helps as well.

    Thanks.

    ZHU

  • M Hussnain Javed Profile Picture
    241 on at

    Thanks for replying.

    I got this idea before but I was not aware of where are the required integration events defined by Microsoft. With further R&D, I found those integration events written on the table level. And I would like to show the code to help others in the future.

    [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(Narration, GenJournalLine.Narration);

       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(Narration, GenJournalLine.Narration);

       end;

       [EventSubscriber(ObjectType::Table, Database::"Cust. Ledger Entry", 'OnAfterCopyCustLedgerEntryFromGenJnlLine', '', false, false)]

       local procedure OnAfterCopyCustLedgerEntryFromGenJnlLine(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")

       begin

           CustLedgerEntry.Validate(Narration, GenJournalLine.Narration);

       end;

       [EventSubscriber(ObjectType::Table, Database::"Bank Account Ledger Entry", 'OnAfterCopyFromGenJnlLine', '', false, false)]

       local procedure OnAfterCopyFromGenJnlLine(var BankAccountLedgerEntry: Record "Bank Account Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")

       begin

           BankAccountLedgerEntry.Validate(Narration, GenJournalLine.Narration);

       end;

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans