Skip to main content
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? 
  • Suggested answer
    Dustin Wolf Profile Picture
    30 on at
    How to post new added field in Sales Journal to Customer Ledger
    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
  • Suggested answer
    YUN ZHU Profile Picture
    85,980 Super User 2025 Season 1 on at
    How to post new added field in Sales Journal to Customer Ledger
    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
    Gerardo Rentería García Profile Picture
    20,947 Most Valuable Professional on at
    How to post new added field in Sales Journal to Customer Ledger

    Hi 

    You have to subscribe to this event.

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

    Best Regards

    Gerardo

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans