Skip to main content

Notifications

Announcements

No record found.

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 20
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
    Dustin Wolf 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
    YUN ZHU 75,595 Super User 2024 Season 2 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
    gdrenteria Profile Picture
    gdrenteria 12,920 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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans