ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request/Bug] Codeunit 365 - Format Address - OnBeforeSalesInvShipTo

Open rvanbekkum opened this issue 6 years ago • 2 comments

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.

rvanbekkum avatar Feb 28 '20 14:02 rvanbekkum

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 Mar 18 '20 06:03 bc-ghost

We also need this publisher to be updated with CustAddr parameter.

Thanks, Zoran M.

plagijat avatar May 14 '20 09:05 plagijat