Skip to content

[Event Request] Codeunit 432 Consolidate - OnBeforeModifyConsolidatedGLEntry #29413

@KateDovgalova

Description

@KateDovgalova

Why do you need this change?

In 4PS Construct want to fill description in Consolidated G/L Entry.

Describe the request

Dear ALAppExtensions team,

On behalf of 4PS I would like to request integration event 'OnBeforeModifyConsolidatedGLEntry' to be added to procedure ClearPreviousConsolidation in codeunit 432 Consolidate.

    local procedure ClearPreviousConsolidation()
    var
        TempGLAccount: Record "G/L Account" temporary;
        AnalysisView: Record "Analysis View";
        TempAnalysisView: Record "Analysis View" temporary;
        AnalysisViewEntry: Record "Analysis View Entry";
        UserSetupManagement: Codeunit "User Setup Management";
        AnalysisViewFound: Boolean;
        IsHandled: Boolean;
    begin
        OnBeforeClearPreviousConsolidation(ConsolidGLEntry);
        ClearAmountArray();
        if not ConsolidGLEntry.SetCurrentKey("G/L Account No.", "Business Unit Code", "Global Dimension 1 Code", "Global Dimension 2 Code", "Posting Date") then
            ConsolidGLEntry.SetCurrentKey("G/L Account No.", "Business Unit Code", "Posting Date");
        ConsolidGLEntry.SetRange("Business Unit Code", BusUnit.Code);
        ConsolidGLEntry.SetRange("Posting Date", StartingDate, EndingDate);
        OnClearPreviousConsolidationOnAfterConsolidGLEntrySetFilters(ConsolidGLEntry);
        if ConsolidGLEntry.FindSet(true) then
            repeat
                IsHandled := false;
                OnClearPreviousConsolidationOnBeforeUpdateAmountArray(ConsolidGLEntry, DeletedAmounts, DeletedDates, DeletedIndex, IsHandled);
                if not IsHandled then begin
                    UserSetupManagement.CheckAllowedPostingDate(ConsolidGLEntry."Posting Date");
                    UpdateAmountArray(ConsolidGLEntry."Posting Date", ConsolidGLEntry.Amount);
                    ConsolidGLEntry.Description := '';
                    ConsolidGLEntry.Amount := 0;
                    ConsolidGLEntry."Debit Amount" := 0;
                    ConsolidGLEntry."Credit Amount" := 0;
                    ConsolidGLEntry."Additional-Currency Amount" := 0;
                    ConsolidGLEntry."Add.-Currency Debit Amount" := 0;
                    ConsolidGLEntry."Add.-Currency Credit Amount" := 0;
                    OnBeforeModifyConsolidatedGLEntry(ConsolidGLEntry); //new
                    ConsolidGLEntry.Modify();
                    if ConsolidGLEntry."G/L Account No." <> TempGLAccount."No." then begin
                        Window.Update(3, ConsolidGLEntry."G/L Account No.");
                        TempGLAccount."No." := ConsolidGLEntry."G/L Account No.";
                        TempGLAccount.Insert();
                    end;
                end;
            until ConsolidGLEntry.Next() = 0;
    [IntegrationEvent(false, false)]
    local procedure OnBeforeModifyConsolidatedGLEntry(var ConsolidatedGLEntry: Record "G/L Entry")
    begin
        //new
    end;

Internal work item: AB#613116

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions