Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

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

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! 
  • UserRecord Profile Picture
    UserRecord 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.
  • Ram Pranav Profile Picture
    Ram Pranav 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
    UserRecord 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.
  • gdrenteria Profile Picture
    gdrenteria 12,183 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?
     
     
  • Verified answer
    Ram Pranav Profile Picture
    Ram Pranav 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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans