Hello Experts,
I have added Shipping Tab in Sales credit memo page and it includes all Shipping elated fields like Ship code, Ship to name, Address etc. Ship to information has been added in all customers so Customer wants to update these fields automatically when we select Sell to Customer No. when create new Sales credit memo. I have added below code however it doesn't work.
modify("Sell-to Customer No.")
{
trigger Onaftervalidate()
var myInt: Integer;
ShiptoAddres: Record "Ship-to Address";
SH: Record "Sales Header";
begin
if ShiptoAddres.get("Sell-to Customer No.") then begin
"Ship-to Code":=ShiptoAddres.Code;
"Ship-to Name":=ShiptoAddres.Name;
"Ship-to Address":=ShiptoAddres.Address;
"Ship-to Address 2":=ShiptoAddres."Address 2";
"Ship-to City":=ShiptoAddres.City;
"Ship-to County":=ShiptoAddres.County;
"Ship-to Country/Region Code":=ShiptoAddres."Country/Region Code";
"Ship-to Contact":=ShiptoAddres.Contact;
end;
end;
I tried the same code in page OnValdate triger as well but no luck.
Any help will be really appreciated. Thanks.
Amy.