microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
770 stars 610 forks source link

[Event Request] Codeunit 13 "Gen. Jnl.-Post Batch" - OnProcessLinesOnBeforeLastCommit #26997

Open RZ440 opened 1 month ago

RZ440 commented 1 month ago

Describe the request

Hello, can you please add a new event OnProcessLinesOnBeforeLastCommit in codeunit 13 "Gen. Jnl.-Post Batch"?

    local procedure ProcessLines(var GenJnlLine: Record "Gen. Journal Line")
.
.
.
        // Update/delete lines
        if GLRegNo <> 0 then
            UpdateAndDeleteLines(GenJnlLine);

        NoSeriesBatch.SaveState();

        DeleteDimBalBatch(GenJnlLine, true);

        OnBeforeCommit(GLRegNo, GenJnlLine, GenJnlPostLine);

        if not SuppressCommit then
            Commit();

        OnProcessLinesOnBeforeClearPostingCodeunits(GenJnlLine, SuppressCommit);
        Clear(GenJnlCheckLine);
        Clear(GenJnlPostLine);
        GenJnlLine.ClearMarks();
        UpdateAnalysisView.UpdateAll(0, true);
        TempGenJnlBatch.OnMoveGenJournalBatch(GLReg.RecordId);
        OnProcessLinesOnBeforeLastCommit(GenJnlLine, PreviewMode);
        if not SuppressCommit then
            Commit();

        if SkippedLine and GuiAllowed then
            Message(SkippedLineMsg);

        OnAfterProcessLines(TempGenJnlLine, GenJnlLine, SuppressCommit, PreviewMode);

        if LastICTransactionNo > 0 then
            ICFeedback.ShowIntercompanyMessage(TempGenJnlLine, ICLastDocNo, ICProccessedLines);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnProcessLinesOnBeforeLastCommit(var GenJournalLine: Record "Gen. Journal Line"; PreviewMode: Boolean)
    begin
    end;

Additional context

We would like to save additional data before committing. Internal work item: AB#545284