web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

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

General Journal Line

(0) ShareShare
ReportReport
Posted on by 130

when we add Fields in General Jounral line , once posted, the data in the field should have to take the value in the table Fixed Asset Ledgers, if you know can anybody help me. I am attaching my codeunit what I have done on this. I  used the event in the codeunit Gen.Jnl.post  but I  didn't get the value


    // [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnPostFixedAssetOnBeforeAssignGLEntry', '', false, false)]
    // local procedure OnPostFixedAssetOnBeforeAssignGLEntry(var GenJournalLine: Record "Gen. Journal Line"; var GLEntry: Record "G/L Entry"; var IsHandled: Boolean; var TempFAGLPostBuf: Record "FA G/L Posting Buffer" temporary; GLEntry2: Record "G/L Entry"; NextEntyNo: Integer;FALedgerEntry: Record "FA Ledger Entry")
    // begin
    //   FALedgerEntry."Product Name"   := GenJournalLine."Product Name";
    // end;
I have the same question (0)
  • Suggested answer
    Vaishnavi J Profile Picture
    3,096 on at

    Hi,

    You can use below logic to write the add your values from general journal line to FA ledger entries

    codeunit 50125 PostFAProductNameCodeunit
    {
       
        Permissions = tabledata "FA Ledger Entry" = rimd;


        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterPostGenJnlLine', '', false, false)]
        local procedure OnAfterPostGenJnlLine(var GenJournalLine: Record "Gen. Journal Line")
        var
            Rec_FaLedgerEntries: Record "FA Ledger Entry";
        begin
            Clear(Rec_FaLedgerEntries);
            Rec_FaLedgerEntries.Reset();
            if (GenJournalLine."Product Name" <> '') or (GenJournalLine."Account Type" = GenJournalLine."Account Type"::"Fixed Asset") then begin
                Rec_FaLedgerEntries.SetRange("Document No.", GenJournalLine."Document No.");
                Rec_FaLedgerEntries.SetRange("FA No.", GenJournalLine."Account No.");
                Rec_FaLedgerEntries.SetRange("Posting Date", GenJournalLine."Posting Date");
                if Rec_FaLedgerEntries.FindFirst() then begin
                    Rec_FaLedgerEntries."Product Name" := GenJournalLine."Product Name";
                    Rec_FaLedgerEntries.Modify(true);
                end;
            end;

        end;

    }

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 595 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 364 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 331 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans