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

Customs field to flow from Sales and Purchase order to General Ledger Entries when posting

(1) ShareShare
ReportReport
Posted on by 56
Hello!
 
I have a few custom fields added in PO & SO forms.I require these fields to flow to General Ledger entries as well when we post directly from SO or PO page.
Any suggestion on any events that can be subscribed to achieve this?
 
Thank you in advance! 
  • Verified answer
    Ram Pranav Profile Picture
    50 on at
    Hi,
     
    You need to create custom fields in both "Gen. Journal Line" and "G/L Entry" table to accommodate your custom fields from "Sales Header" or "Purchase Header" table.
     
    Subscribe to the event OnAfterCopyGenJnlLineFromSalesHeader / OnAfterCopyGenJnlLineFromPurchHeader from the table "Gen. Journal Line" to assign the values of custom fields from "Sales Header" or "Purchase Header" to the "Gen. Journal Line" custom fields.
     
    Subscribe to the event OnAfterCopyGLEntryFromGenJnlLine from the table "G/L Entry" to assign the values of custom fields from "Gen. Journal Line" to "G/L Entry" custom fields.
     
    Regards,
    Ram Pranav.
  • Gerardo Rentería García Profile Picture
    27,623 Super User 2026 Season 2 on at
    Hello maybe this can help 
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterInsertGLEntry', '', false, false)]
    local procedure OnAfterInsertGLEntry(var Sender: Codeunit "Gen. Jnl.-Post Line"; GLEntry: Record "G/L Entry"; GenJnlLine: Record "Gen. Journal Line"; TempGLEntryBuf: Record "G/L Entry" temporary; CalcAddCurrResiduals: Boolean);
    begin
    end;
     
    #msdyn365bc - Flow Custom Fields from Sales Header to Customer Ledger?
     
     
  • UserRecord Profile Picture
    56 on at
    Hi Ram,
     
    I tried you using your suggestion, however, it errors out saying There is no entry in Gen. Journal Line.
  • Ram Pranav Profile Picture
    50 on at
    It would be helpful to analyse if you share your code.
     
    Regards,
    Ram Pranav.
  • UserRecord Profile Picture
    56 on at
    Hello!
     
    The events OnAfterCopyGenJnlLineFromSalesHeader / OnAfterCopyGenJnlLineFromPurchHeader work in case of Invoice. However, if I am trying select Receive option they are not trigerred.
    Can suggestions on any other events?
     
    Thank you in advance.

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 624 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 440 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 244 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans