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

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
    Customs field to flow from Sales and Purchase order to General Ledger Entries when posting
    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
    23,855 Most Valuable Professional on at
    Customs field to flow from Sales and Purchase order to General Ledger Entries when posting
    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
    Customs field to flow from Sales and Purchase order to General Ledger Entries when posting
    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
    Customs field to flow from Sales and Purchase order to General Ledger Entries when posting
    It would be helpful to analyse if you share your code.
     
    Regards,
    Ram Pranav.
  • UserRecord Profile Picture
    54 on at
    Customs field to flow from Sales and Purchase order to General Ledger Entries when posting
    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

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
OussamaSabbouh Profile Picture

OussamaSabbouh 2,267

#2
Sumit Singh Profile Picture

Sumit Singh 2,098

#3
YUN ZHU Profile Picture

YUN ZHU 1,766 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans