ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 273 "Bank Acc. Reconciliation" - OnBeforeImportAndProcessToNewStatement & OnAfterConfidenceLevelPermitToPost

Open AlaAuz opened this issue 6 years ago • 1 comments

Hello, Is it possible to get these two events?

procedure ImportAndProcessToNewStatement()
    var
        BankAccount: Record "Bank Account";
        BankAccReconciliation: Record "Bank Acc. Reconciliation";
        DataExch: Record "Data Exch.";
        DataExchDef: Record "Data Exch. Def";
        DummyBankAccReconciliationLine: Record "Bank Acc. Reconciliation Line";
        LastStatementNo: Code[20];
    begin
		//>>>>>>>>>>>>>>>>>>>>>>>>
        OnBeforeImportAndProcessToNewStatement(BankAccReconciliation, DataExch, DataExchDef, IsHandled);
        If IsHandled then
            exit;
		//<<<<<<<<<<<<<<<<<<<<<<<<
        if not SelectBankAccountToUse(BankAccount, true) then
            exit;
        BankAccount.GetDataExchDef(DataExchDef);
        DataExch."Related Record" := BankAccount.RecordId;
        if not DataExch.ImportFileContent(DataExchDef) then
            exit;
        BankAccount.LockTable();
        LastStatementNo := BankAccount."Last Statement No.";
        CreateNewBankPaymentAppBatch(BankAccount."No.", BankAccReconciliation);
        if not ImportStatement(BankAccReconciliation, DataExch) then begin
            DeleteBankAccReconciliation(BankAccReconciliation, BankAccount, LastStatementNo);
            Message(NoTransactionsImportedMsg);
            exit;
        end;
        if not DummyBankAccReconciliationLine.LinesExist(BankAccReconciliation) then begin
            DeleteBankAccReconciliation(BankAccReconciliation, BankAccount, LastStatementNo);
            Message(NoTransactionsImportedMsg);
            exit;
        end;
        Commit();
        ProcessStatement(BankAccReconciliation);
    end;
[IntegrationEvent(false, false)]
    local procedure OnBeforeImportAndProcessToNewStatement(var BankAccReconciliation: Record "Bank Acc. Reconciliation"; var DataExch: Record "Data Exch."; var DataExchDef: Record "Data Exch. Def"; var IsHandled: Boolean)
    begin
    end;

procedure ProcessStatement(var BankAccReconciliation: Record "Bank Acc. Reconciliation")
    begin
        CODEUNIT.Run(CODEUNIT::"Match Bank Pmt. Appl.", BankAccReconciliation);
        if ConfidenceLevelPermitToPost(BankAccReconciliation) then
            CODEUNIT.Run(CODEUNIT::"Bank Acc. Reconciliation Post", BankAccReconciliation)
        //>>>>>>>>>>>>>>>>>>
        //else
        else begin
            ANOOnAfterConfidenceLevelPermitToPost(BankAccReconciliation, IsHandled);
            if not IsHandled then begin
            if GuiAllowed then
                OpenWorksheet(BankAccReconciliation);
            end;
        end;
        //<<<<<<<<<<<<<<<<<<<
    end;
    [IntegrationEvent(false, false)]
    local procedure OnAfterConfidenceLevelPermitToPost(var BankAccReconciliation: Record "Bank Acc. Reconciliation"; var IsHandled: Boolean)
    begin
    end;

AlaAuz avatar May 11 '20 12:05 AlaAuz

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.

bc-ghost avatar May 15 '20 09:05 bc-ghost