ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Table 36 Sales Header - Ship-To Code - OnValidate

Open DominikWidmann opened this issue 5 years ago • 1 comments

We need an event in the OnValidate-Trigger of field "Ship-To Code" of table "Sales Header" to customize the behavior right before the field "Location Code" is validated. From our perspective the existing local procedure "SetCustomerLocationCode" can be used for this (as it is done in the procedure "CopyShipToCustomerAddressFieldsFromCust"). Our suggestion:

...
                CopyShipToAddress := not IsCreditDocType;
                OnValidateShipToCodeOnBeforeCopyShipToAddress(Rec, xRec, CopyShipToAddress);
                if CopyShipToAddress then
                    if "Ship-to Code" <> '' then begin
                        if xRec."Ship-to Code" <> '' then begin
                            GetCust("Sell-to Customer No.");
                            // START --> the following two lines are replaced
                            //if Cust."Location Code" <> '' then
                            //    Validate("Location Code", Cust."Location Code");
                            SetCustomerLocationCode();
                            // <--END
                            "Tax Area Code" := Cust."Tax Area Code";
                        end;
                        ShipToAddr.Get("Sell-to Customer No.", "Ship-to Code");
                        SetShipToCustomerAddressFieldsFromShipToAddr(ShipToAddr);
                    end else
...

DominikWidmann avatar May 06 '21 11:05 DominikWidmann

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 May 14 '21 05:05 JesperSchulz