I think the answer to this is probably a straightforward "no", however:
I create Item records in a temporary table ready for transfer to another company..
The transfer of the records from temp table to real Item table must be auto. and if there is a validation error then a run-time error must be avoided and instead an entry put in an error table. Fine in terms of field type and length validation I use
IF NOT EVALUATE THEN ErrorLog.
But I want FULL validation - as the new records are created I want to call the VALIDATE trigger of each field ie.
Item.VALIDATE("No.",Temp."No.);
AND NOT Item."No." := Temp."No."
The problem is that if the VALIDATE fails then an run-time error occurs which I can't easily trap as IF VALIDATE THEN has never been an option
So to solve I can write all the code from the VALIDATE triggers into my routine and trap any problems there :shock: :shock: :shock:
But that's an insane amount of work and a nightmare to maintain.....so the question (finally!) is.....
Without writing all the Item table VALIDATE code into my routine is there another way..... :?
Comments
It says in the documentation 'you can setup Dynamics NAV to continue even if a runtime error occurs' but no mention of how??
I don't want any error messages to display, all must be trapped and written to table...?
you'll find the way...otherwise (i'm sponsoring a thread of mine )
http://www.mibuso.com/forum/viewtopic.php?f=5&t=31763
anyway, even in my thread i use the if codeunit.run...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
If NOT MyCodeUnit.RUN THEN BEGIN
MyLastError := GETLASTERROR;
MyLOG.INSERT(MyLastError.);
END;
Something similar. Search the forum for GETLASTERROR and you'll find plenty of info.
Brilliant, fantastic, thank you all =D> =D>
This would be a correct syntax:
EDIT: maybe you meant that the instruction is GETLASTERRORTEXT and not GETLASTERROR...ok, got it
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
If I remember correctly, at least in some versions, MESSAGE windows can lead to locked resources if they stay open...
any idea?
when it want to insert to the table, sometimes have duplicate data
i want to catch that error message and then store it in log file
yes i did realize and already changed it become
but i think still wrong
what i want is if failed to insert... then getlasterror put in variable strline2
from this strline2, i want to put it in log file