[Event Request/Bug] Codeunit 365 - Format Address - OnBeforeSalesInvShipTo
Dear ALAppExtensions team,
Through this issue we would to report a bug in Codeunit 365 Format Address and would accordingly like to request the event OnBeforeSalesInvShipTo to be changed as follows:
procedure SalesInvShipTo(var AddrArray: array[8] of Text[100]; CustAddr: array[8] of Text[100]; var SalesInvHeader: Record "Sales Invoice Header"): Boolean
var
IsHandled: Boolean;
Result: Boolean; //NEW
begin
//OLD: OnBeforeSalesInvShipTo(AddrArray, SalesInvHeader, IsHandled);
OnBeforeSalesInvShipTo(AddrArray, CustAddr, SalesInvHeader, IsHandled, Result); //NEW
if IsHandled then
//OLD: exit;
exit(Result);
with SalesInvHeader do begin
FormatAddr(
AddrArray, "Ship-to Name", "Ship-to Name 2", "Ship-to Contact", "Ship-to Address", "Ship-to Address 2",
"Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code");
if "Sell-to Customer No." <> "Bill-to Customer No." then
exit(true);
for i := 1 to ArrayLen(AddrArray) do
if AddrArray[i] <> CustAddr[i] then
exit(true);
end;
exit(false);
end;
Explanation: The procedure has a return value, but when IsHandled = true it exits without a return value. Also the procedure has an additional parameter CustAddr that is never passed to the event, so we would like to request it to be added as well.
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.
We also need this publisher to be updated with CustAddr parameter.
Thanks, Zoran M.