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" – OnPostGenJournalLineOnBeforeCheckDocumentNo #27007

Open RZ440 opened 1 month ago

RZ440 commented 1 month ago

Describe the request

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

    local procedure PostGenJournalLine(var GenJournalLine: Record "Gen. Journal Line"; CurrentICPartner: Code[20]; ICTransactionNo: Integer) Result: Boolean
    var
        IsPosted: Boolean;
        SavedPostingDate: Date;
        SavedVATReportingDate: Date;
    begin
        if GenJournalLine.NeedCheckZeroAmount() and (GenJournalLine.Amount = 0) and GenJournalLine.IsRecurring() then
            exit(false);

        GenJnlPostLine.SetPreviewMode(PreviewMode);
        LineCount := LineCount + 1;
        if CurrentICPartner <> '' then
            GenJournalLine."IC Partner Code" := CurrentICPartner;
        UpdateDialog(RefPostingState::"Posting Lines", LineCount, NoOfRecords);
        MakeRecurringTexts(GenJournalLine);
        OnPostGenJournalLineOnBeforeCheckDocumentNo(GenJournalLine, GLRegNo, GenJnlTemplate);
        CheckDocumentNo(GenJournalLine);
        GenJnlLine5.Copy(GenJournalLine);
        PrepareGenJnlLineAddCurr(GenJnlLine5);
        UpdateIncomingDocument(GenJnlLine5);
        UpdateDimBalBatchName(GenJnlLine5);
    [IntegrationEvent(false, false)]
    local procedure OnPostGenJournalLineOnBeforeCheckDocumentNo(var GenJnlLine: Record "Gen. Journal Line"; GLRegNo: Integer; GenJournalTemplate: Record "Gen. Journal Template")
    begin
    end;

Additional context

We would like to check if the template is recurring because then we run some additional processing. Internal work item: AB#545263