Hello I have the following code.
if Item.findset repeat
if MyCodeUnit.run(Item) then begin
WriteLog( GETLASTERRORTEXT);
end;
until Item.next = 0;
MyCodeUnit.run just updates the Item record.
If there is an error on last Item, will the whole batch role back or not?
I tested this and it does not role back. So where is the commit?
Comments
If you want to roll back, you might want to add ERROR('') (that also stops the loop, which is not happening with your code... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
so, an error popps up an a rollback begins.
Regards
If you want the errors to propagate to the screen then just use codeunit.run without the If statement.
This works very well if you're executing code on a NAS and don't want errors to propagate.
Epimatic Corp.
http://www.epimatic.com
f.ex.
I want to handle Errors without stopping the whole process.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
i tried in Objectversion 3.70 but the code i entered above journalised all positive entries (the "IF"-Case but not the "IF NOT"-Case).
Do u know in which Version is this possible?
Thx
Do you mean the IF blabla.MODIFY works, but the IF NOT blable.MODIFY does not?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Statement1 is executed for all Modified Lines(with no Errors) but not for the Error (= no Modification) Lines.
Hope It's clear what i Mean :?
Did you try:
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog