Dear all,
I am trying to to set default Transfer-from and Transfer-to Locations on the Transfer Order Card on New Page or New Record; I also want to validate these values.
What I have tried so far is to add Transfer-from and Transfer-to lookup (to Location table) fields in the User Setup table, hence pointing each user to his/her default location. Then, I have written
vUserSetup.RESET; //introduced the User Setup table as a variable
vUserSetup.SETFILTER(vUserSetup."User ID",'%1',USERID);
IF vUserSetup.FINDFIRST THEN BEGIN
"Transfer-from Code":=vUserSetup."Transfer Location-from";
VALIDATE("Transfer-from Code",vUserSetup."Transfer Location-from");
END;
The code was entered either OnInsert() of the Transfer Header table or the Transfer Order page. In the first case I get an "Transfer Header No. 'XXXX' does not exist" error, in the second I get the value inserted by with no validation.
Any help is really welcomed, thank you very much in advance
0
Comments
Can you please ensure you added your code at the end of OnInsert table trigger, after this 2 statements?