ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 11000002 "CBG Journal Telebank Interface" - OnBeforeModifyCBGStatementLine

Open WJMSmit opened this issue 5 years ago • 1 comments

Please add a new event 'OnBeforeModifyCBGStatementLine' to procedure 'InsertCBGStatementLine', to allow additional modifications to CBGStatementLine:

local procedure InsertCBGStatementLine(var CBGStatementLine: Record "CBG Statement Line"; CBGStatement: Record "CBG Statement"; PaymentHistLine: Record "Payment History Line"; UseAdjustedAmount: Boolean; AdjustedAmount: Decimal)
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeInsertCBGStatementLine(CBGStatementLine, CBGStatement, PaymentHistLine, IsHandled);
    if IsHandled then
        exit;

    CBGStatementLine.Init();
    CBGStatementLine.InitRecord(CBGStatementLine);
    CBGStatementLine.Validate(Identification, PaymentHistLine.Identification);
    CBGStatementLine.Insert(true);
    if UseAdjustedAmount then begin
        CBGStatementLine."Amount Settled" := AdjustedAmount;
        CBGStatementLine.Validate(Amount, AdjustedAmount)
    end else begin
        CBGStatementLine."Amount Settled" := CBGStatementLine.Amount;
        CBGStatementLine.Validate(Amount);
    end;
    CBGStatementLine.Validate("Shortcut Dimension 1 Code", PaymentHistLine."Global Dimension 1 Code");
    CBGStatementLine.Validate("Shortcut Dimension 2 Code", PaymentHistLine."Global Dimension 2 Code");
    // << BEGIN - OnBeforeModifyCBGStatementLine
    OnBeforeModifyCBGStatementLine(CBGStatementLine, CBGStatement, PaymentHistLine);
    // >> END - OnBeforeModifyCBGStatementLine
    CBGStatementLine.Modify(true);
end;

// << BEGIN - OnBeforeModifyCBGStatementLine
[IntegrationEvent(false, false)]
local procedure OnBeforeModifyCBGStatementLine(var CBGStatementLine: Record "CBG Statement Line"; CBGStatement: Record "CBG Statement"; PaymentHistoryLine: Record "Payment History Line")
begin
end;
// >> END - OnBeforeModifyCBGStatementLine

WJMSmit avatar Nov 11 '21 13: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 25 '21 05:11 JesperSchulz