Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

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

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? 
Categories:
  • 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 68,757 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 8,918 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,349 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,212 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans