Hello,
I used the function GETLASTERRORTEXT in version 5.0.
Now I should use the same function in a db ver 4.00 sp 3 but I don't have this function.
I need it to log if a codeunit goes wrong, returns false:
Following is the code running on 5.0
IF NOT CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post Batch",gRecItemJournalLine) THEN BEGIN
retValue := FALSE;
ErrorLogMgt.SetInterruptingSeverity := 0;
ErrorLogMgt.LogError(TaskCode,
TaskID,
'BATCH_ERROR',
COPYSTR(GETLASTERRORTEXT,1,250)
,(GETLASTERRORTEXT,251,500)
,0);
CLEARLASTERROR;
END
How can I have same functionality in 4.0 sp3?
Thank you
0
Comments
GETLASTERRORTEXT is new in NAV 5.0.
You can do a technical upgrade to NAV 5.0. Or a full upgrade, but take will take a lot more time.
Tino Ruijs
Microsoft Dynamics NAV specialist
GETLASTERRORTEXT is new in NAV 5.0.
You can do a technical upgrade to NAV 5.0. Or a full upgrade, but take will take a lot more time.
Tino Ruijs
Microsoft Dynamics NAV specialist
How did you do before NAV 5.0?
Sorry.
andy76 wrote: you should write
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
...but you can use an automation for imitation GetLastError function. For example NAV Timer - run some code on tick event and catch all errors on special event which return last error...
if the codeunit runs ok, delete the logentry
You can't catch the contents of the message.
...other automation http://mibuso.com/dlinfo.asp?FileID=886