Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

G/L Resister No.

(3) ShareShare
ReportReport
Posted on by 51
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;
}
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    16,784 Super User 2025 Season 1 on at
  • Raj Borad Profile Picture
    1,140 on at
    G/L Resister No.
     
    If it works, Please Mark Mohana's reply as verified answer, so everyone in the community gets updated.
  • Suggested answer
    Rajiv Sewsarran Profile Picture
    51 on at
    G/L Resister No.
    Hi Mohana,

    This works! thanks! 
  • Verified answer
    Mohana Yadav Profile Picture
    60,232 Super User 2025 Season 1 on at
    G/L Resister No.
    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.")));
            }

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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,382

#2
YUN ZHU Profile Picture

YUN ZHU 1,008 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 880

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans