Copy From is a function you've added to the ship-to address card right?
Press F9 on that function in designer mode.
Copy and past my code in OnPush()
In the CAL locals add variables
CodeBuffer (code 20)
CustomerBuffer (code 20)
ShipToAddress (Rec 222)
Now just save it and test it, and see if it fits your needs?
So after saving it, run the page in user mode from any given customer, press F3 to add new ship-to address.
Fill TEST in the code field.
Start function Copy From, and select the ship-to address to copy.
Answers
You can try something like this in your Copy From function:
testfield(code);
CodeBuffer := Code;
CustomerBuffer := "Customer No.";
IF FORM.RUNMODAL(0,ShipToAddress) = ACTION::LookupOK THEN BEGIN
TRANSFERFIELDS(ShipToAddress);
"Customer No." := CustomerBuffer;
Code := CodeBuffer;
CurrForm.UPDATE(TRUE);
END;
But this is tricky, because it overwrites existing ship-to addresses in a sec.
You'll be advised to add some extra checks.
Press F9 on that function in designer mode.
Copy and past my code in OnPush()
In the CAL locals add variables
CodeBuffer (code 20)
CustomerBuffer (code 20)
ShipToAddress (Rec 222)
Now just save it and test it, and see if it fits your needs?
So after saving it, run the page in user mode from any given customer, press F3 to add new ship-to address.
Fill TEST in the code field.
Start function Copy From, and select the ship-to address to copy.