[Event request] PAG 475 OnBeforeOnAfterGetRecord
For Slovenian localization we have our own VAT statement report, including the CalcLineTotal function which we would like to call instead of current one from Report 12. Our suggestion:
-
add a function CalcColumnValue which calculates the ColumnValue variable
-
on begining of the function set an event publisher with var parameter IsHandled
trigger OnAfterGetRecord() begin CalcColumnValue(Rec, ColumnValue, 0); if "Print with" = "Print with"::"Opposite Sign" then ColumnValue := -ColumnValue; end;
procedure CalcColumnValue(Rec: Record "VAT Statement Line"; var TotalAmount: Decimal; Level: Integer) var IsHandled: Boolean; begin OnBeforeCalcColumnValue(Rec, ColumnValue, 0, IsHandled); if IsHandled then exit; VATStatement.CalcLineTotal(Rec, ColumnValue, 0); end;
[IntegrationEvent(true, false)] local procedure OnBeforeCalcColumnValue(VATStatementLine: Record "VAT Statement Line"; var TotalAmount: Decimal; Level: Integer; var IsHandled: Boolean) begin end;
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.