... REPORT.RUNMODAL("Object No.",FALSE,FALSE);The report does execute the following for every Sales Header within a certain filter:
... IF Codeunit1.RUN(SalesHeader) THEN BEGIN ... IF SalesLine.FINDSET THEN REPEAT IF Codeunit2.RUN(SalesLine) THEN; UNTIL SalesLine.NEXT = 0;I thought this IF XXX.RUN(Rec) THEN construction makes sure that no error can break the loop. I mean if there is an error with a certain Sales Line it should go to the next Sales Line and try to execute the codeunit with this next Sales Line as parameter. But it always ends up at the singleinstance codeunit. Even if there is an error in the first codeunit for Sales Header. What am I doing wrong?
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
In the Timer-Event trigger I just put the call to the worker codeunit.
In the TimerError-Event Trigger I put code like this
In these scenarios I have never used "if codeunit.run" construct.
Hope this helps
Thomas
Yes but only if you are on NAV 5.00... ;-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No, it shouldn't, but that there is no error in the event log is good thing and bad thing. Good that we know that there is no another uncatched error, bad is that it will not help... :-k
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
That's why I've done some technical upgrades. I've got this approach running with database versions back to 3.60, but with 5.x (or higher) clients.
Thomas
I even tried to execute the report's functionality through a new codeunit. Same error.
And I commented out all code in OnRun of codeunit1. Still the same error.
Back to topic: Unfortunately there is no way to get the real last error in a "IF codeunit.RUN" contruction until 5.00 and GETLASTERROR. :-k