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...
Suggested Answer

How to post new added field in Sales Journal to Customer Ledger

(0) ShareShare
ReportReport
Posted on by 22
I have added 2 new fields in Sales Journal. But in Post those are not passing to Customer Ledger. I have created same fields in Customer Ledger too. How can I post the values of 2 new fields? 
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,213 Most Valuable Professional on at

    Hi 

    You have to subscribe to this event.

    And here pass the values from General Journal Line to Customer Ledger Entry.

    Best Regards

    Gerardo

  • Suggested answer
    YUN ZHU Profile Picture
    95,379 Super User 2025 Season 2 on at
    Hi, hope the following helps.
    tableextension 50119 MyExtension extends "Gen. Journal Line"
    {
        fields
        {
            field(50100; ZYTest; Text[100])
            {
                Caption = 'ZY Test';
                DataClassification = CustomerContent;
            }
        }
    }
    
    pageextension 50121 CustomerLedgerEntriesExt extends "Customer Ledger Entries"
    {
        layout
        {
            addafter("Document No.")
            {
                field(ZYTest; Rec.ZYTest)
                {
                    ApplicationArea = All;
                }
            }
        }
    }
    
    tableextension 50121 CustLedgerEntryExt extends "Cust. Ledger Entry"
    {
        fields
        {
            field(50100; ZYTest; Text[100])
            {
                Caption = 'ZY Test';
                DataClassification = CustomerContent;
            }
        }
    }
    
    codeunit 50116 CcBccHandle
    {
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", OnAfterInitCustLedgEntry, '', false, false)]
        local procedure OnAfterInitCustLedgEntry(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; var GLRegister: Record "G/L Register");
        begin
            CustLedgerEntry.ZYTest := GenJournalLine.ZYTest;
        end;
    }
    Test:
     
    Thanks.
    ZHU
  • Suggested answer
    Dustin Wolf Profile Picture
    30 on at
    Hello

    I would use the function CopyFromGenJnlLine from the Cust. Ledger Entry Table



    Just create a subscriber, hooking on to this function and adding the code to add new fields here.

    - Dustin Wolf
    ​​​​​​​Accent Software

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,990

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,576 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans