ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 5055 "CustVendBank-Update" - OnAfterUpdateBankAccountProcedure

Open WJMSmit opened this issue 5 years ago • 3 comments

Please add a new event 'OnAfterUpdateBankAccountProcedure' to procedure 'UpdateBankAccount', as already available in 'UpdateCustomer' and 'UpdateVendor', to be able to make final modifications to the concerning Contact.

procedure UpdateBankAccount(var Cont: Record Contact; var ContBusRel: Record "Contact Business Relation")
begin
    with BankAcc do begin
        Get(ContBusRel."No.");
        NoSeries := "No. Series";
        OurContactCode := "Our Contact Code";
        Validate("Currency Code", Cont."Currency Code");
        BankAccountCopyFieldsFromCont(Cont);
        "No." := ContBusRel."No.";
        "No. Series" := NoSeries;
        "Our Contact Code" := OurContactCode;
        "Last Date Modified" := Today;
        OnAfterUpdateBankAccount(BankAcc, Cont, ContBusRel);
        Modify;
    end;
    //----------------------------------------OnAfterUpdateBankAccountProcedure:BEGIN
    OnAfterUpdateBankAccountProcedure(BankAcc, Cont, ContBusRel);
    //----------------------------------------OnAfterUpdateBankAccountProcedure:END 
end;

//----------------------------------------OnAfterUpdateBankAccountProcedure:BEGIN
[IntegrationEvent(false, false)]
local procedure OnAfterUpdateBankAccountProcedure(var BankAccount: Record "Bank Account"; var Contact: Record Contact; var ContBusRel: Record "Contact Business Relation")
begin
end;
//----------------------------------------OnAfterUpdateBankAccountProcedure:END

WJMSmit avatar Nov 09 '21 10:11 WJMSmit

Couldn't you use the OnAfterUpdateBankAccount two lines above your requested event?

dannoe avatar Nov 09 '21 17:11 dannoe

The parameter for Contact is not by reference in event 'OnAfterUpdateBankAccount'. Adding 'var' in front of the parameter would also do the trick, but I've requested for this new event to keep in sync with 'UpdateCustomer' and 'UpdateVendor.

WJMSmit avatar Nov 09 '21 18:11 WJMSmit

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. 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 Nov 12 '21 08:11 JesperSchulz