ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[EventRequest] Codeunit 1254 "Match Bank Pmt. Appl." - OnBeforeMatchBankPayments()

Open MatjazSega opened this issue 5 years ago • 1 comments

Hello,

We have to replace standard matching code (CU 1255 "Match Bank Payments") with our custom matching algorithm. To achieve this, we need new event in codeunit 1254 "Match Bank Pmt. Appl.":

codeunit 1254 "Match Bank Pmt. Appl."
{
    TableNo = "Bank Acc. Reconciliation";

    trigger OnRun()
    var
        MatchBankPayments: Codeunit "Match Bank Payments";
        // NEW VARIABLES >>>
        IsHandled: Boolean;
        // NEW VARIABLES <<<
    begin
        // NEW CODE >>>
        OnBeforeMatchBankPayments(Rec, IsHandled);
        if IsHandled then
          exit;
        // NEW CODE <<<
        BankAccReconciliationLine.FilterBankRecLines(Rec);
        if BankAccReconciliationLine.FindFirst() then begin
            MatchBankPayments.SetApplyEntries(true);
            MatchBankPayments.Run(BankAccReconciliationLine);
        end;
        OnAfterMatchBankPayments(Rec);
    end;

    ....

    // NEW EVENT >>>
    [IntegrationEvent(false, false)]
    local procedure OnBeforeMatchBankPayments(var BankAccReconciliation: Record "Bank Acc. Reconciliation"; var IsHandled: Boolean)
    begin
    end;
    // NEW EVENT <<<
}

Thank you in advance!

Best regards, Matjaž

MatjazSega avatar Mar 19 '21 14:03 MatjazSega

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar Mar 22 '21 16:03 JesperSchulz