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 54
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! 
I have the same question (0)
  • 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,024 Most Valuable Professional 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
    54 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
    54 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,260 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,515 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,373

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans