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" - OnProcessLinesOnBeforeAssignVATDate #26994

Open RZ440 opened 1 month ago

RZ440 commented 1 month ago

Describe the request

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

local procedure ProcessLines(var GenJnlLine: Record "Gen. Journal Line")
.
.
.
        // Check lines
        LineCount := 0;
        StartLineNo := GenJnlLine."Line No.";
        NoOfRecords := CountGenJournalLines(GenJnlLine);
        GenJnlCheckLine.SetBatchMode(true);
        repeat
            LineCount := LineCount + 1;
            UpdateDialog(RefPostingState::"Checking lines", LineCount, NoOfRecords);
            IsHandled := false;
            OnProcessLinesOnBeforeAssignVATDate(GenJnlLine, IsHandled);
            if not IsHandled then begin
                AssignVATDateIfEmpty(GenJnlLine);
                CheckLine(GenJnlLine, PostingAfterWorkingDateConfirmed);
                TempGenJnlLine := GenJnlLine5;
                TempGenJnlLine.Insert();
            end;
            if GenJnlLine.Next() = 0 then
                GenJnlLine.FindFirst();
        until GenJnlLine."Line No." = StartLineNo;
        if GenJnlTemplate.Type = GenJnlTemplate.Type::Intercompany then
            CheckICDocument(TempGenJnlLine);
    [IntegrationEvent(false, false)]
    local procedure OnProcessLinesOnBeforeAssignVATDate(GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)
    begin
    end;

Additional context

We would like to do some checks and validations here, and skip some lines that cannot easily be filtered. Internal work item: AB#545276