microsoft / ALAppExtensions

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

[Event Request] Codeunit 13 "Gen. Jnl.-Post Batch" - OnCheckGenJnlLineOnBeforeSetFilter #27003

Closed RZ440 closed 3 weeks ago

RZ440 commented 2 months ago

Describe the request

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

    local procedure CheckGenJnlLine(var MarkedGenJnlLine: Record "Gen. Journal Line"; var GenJournalLine: Record "Gen. Journal Line")
    var
        StartBatchName: Code[10];
        IsHandled: Boolean;
    begin
        if not GenJournalLine.Find() then
            GenJournalLine.FindSet();
        IsHandled := false;
        OnCheckGenJnlLineOnBeforeSetFilter(GenJournalLine, IsHandled);
        if not IsHandled then
            GenJournalLine.SetRange("Posting Date", 0D, WorkDate());
        if GenJournalLine.FindSet() then begin
            StartLineNo := GenJournalLine."Line No.";
            StartBatchName := GenJournalLine."Journal Batch Name";
            repeat
                if IsNotExpired(GenJournalLine) and IsPostingDateAllowed(GenJournalLine) and IsNotNullAmountLine(GenJournalLine) then begin
                    MarkedGenJnlLine := GenJournalLine;
                    if GenJournalLine."Recurring Method" in
                        [GenJournalLine."Recurring Method"::"BD Balance by Dimension", GenJournalLine."Recurring Method"::"RBD Reversing Balance by Dimension"]
                    then begin
    [IntegrationEvent(false, false)]
    local procedure OnCheckGenJnlLineOnBeforeSetFilter(var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)
    begin
    end;

Additional context

We do not want to set the posting date filter because we would like to allow users to decide about if they want to post future lines. Internal work item: AB#545272

JesperSchulz commented 3 weeks ago

Availability update: We will publish a fix for this issue in the next update for release 25.

Build ID to track: 25206.