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 Change Request] Codeunit 13 "Gen. Jnl.-Post Batch" – OnBeforeUpdateAndDeleteLines #27004

Open RZ440 opened 1 month ago

RZ440 commented 1 month ago

Describe the request

Hello, can you please add "GenJnlLine2", "GenJnlTemplate", and "GenJnlBatch" to the event OnBeforeUpdateAndDeleteLines in codeunit 13 "Gen. Jnl.-Post Batch"?

    local procedure UpdateAndDeleteLines(var GenJnlLine: Record "Gen. Journal Line")
    var
        TempGenJnlLine2: Record "Gen. Journal Line" temporary;
        RecordLinkManagement: Codeunit "Record Link Management";
        OldVATAmount: Decimal;
        OldVATPct: Decimal;
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeUpdateAndDeleteLines(GenJnlLine, SuppressCommit, IsHandled, GenJnlLine2, GenJnlTemplate, GenJnlBatch);
        if IsHandled then
            exit;
    [IntegrationEvent(true, false)]
    local procedure OnBeforeUpdateAndDeleteLines(var GenJournalLine: Record "Gen. Journal Line"; CommitIsSuppressed: Boolean; var IsHandled: Boolean; var GenJournalLine2: Record "Gen. Journal Line"; GenJournalTemplate: Record "Gen. Journal Template"; var GenJournalBatch: Record "Gen. Journal Batch")
    begin
    end;

Additional context

We would like to set global variables in GenJournalLine2, check some values of GenJournalTemplate, and in some cases modify GenJournalBatch. Internal work item: AB#545260