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...
Answered

G/L Resister No.

(4) ShareShare
ReportReport
Posted on by 55
Hi All,

I would like to capture the G/L Register No. from the Posted General Journal, on the General Ledger Entries Page.

I've done a few things so far but nothing seems to work

this is what I've done.

Any assistance would be greatly appreciated.

Tableextension - G/L Entry
 
        field(50117; "G/L Register No."; Integer)
        {
            Caption = 'G/L Register No.';
        }
 
and this codeunit
 
 
codeunit 50101 GLEntryTransferHandler
{
    [EventSubscriber(ObjectType::Table, Database::"G/L Entry", 'OnAfterInsertEvent', '', false, false)]
    local procedure OnAfterInsertGLEntry(var Rec: Record "G/L Entry")
    var
        PostedGenJnlLine: Record "Posted Gen. Journal Line";
    begin
        // Match by Document No.
        PostedGenJnlLine.SetRange("Document No.", Rec."Document No.");
 
        if PostedGenJnlLine.FindFirst() then begin
            if Rec."G/L Register No." <> PostedGenJnlLine."G/L Register No." then begin
                Rec."G/L Register No." := PostedGenJnlLine."G/L Register No.";
                Rec.Modify();
            end;
        end else begin
 
        end;
    end;
}
I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Create it as a FlowField like this
     
            field(71102; "G/L Register No."; Integer)
            {
                Caption = 'G/L Register No.';
                FieldClass = FlowField;
                Editable = false;
                CalcFormula = Lookup("Posted Gen. Journal Line"."G/L Register No." WHERE("Document No." = FIELD("Document No.")));
            }
  • Suggested answer
    Rajiv Sewsarran Profile Picture
    55 on at
    Hi Mohana,

    This works! thanks! 
  • Raj Borad Profile Picture
    1,428 on at
     
    If it works, Please Mark Mohana's reply as verified answer, so everyone in the community gets updated.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,838 Super User 2025 Season 2 on at

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

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans