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

Announcements

No record found.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans