Hi,
We have created a funtionality to Copy Data between 2 Tables using RecRef/Fieldref..
The SourceTable is known, as created by us, but the destination table, can differ, especialy the Code inside the triggers.
Our Code contains a line like this:
IF TempSyncField."Validate Trigger" THEN
TargetFieldRef.VALIDATE;
Unfortunatly, if there is a code inside the Table Validate, that throws an Exception (like runtime Error) our code will send back a strange error message, that is not very helpful. :-(
Is there any "Workaround" to check exceptions from this code, without breaking the run of the code?
Thanks for any hints.
Stephan
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
If a CodeunitVar.RUN returns false (ie an error was caught) GETLASTERROR will have the error message and you can call functions in the codeunit to extract variables and workout where it got to.
That way you should be able to give an error message like:
Error Validating the value 'N/A' into the "BB Code" field on the "Customer" table : BB Code does not exist.
TVision Technology Ltd