GETLASTERRORTEXT in NAV 4.0 SP3

andy76
Member Posts: 616
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
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
-
You can't have the same functionality in NAV 4.0 sp3.
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 specialist0 -
You can't have the same functionality in NAV 4.0 sp3.
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 specialist0 -
I know that but there is not some workaround for my case.
How did you do before NAV 5.0?0 -
You coudn't. It simply did not exist.
Sorry.0 -
Hi All
...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...0 -
You can catch errors in 4.0 by assuming a field or record goes wrong and write this in your logentry.
if the codeunit runs ok, delete the logentry
You can't catch the contents of the message.0 -
it's real but only under NAS...because error message will be reflected as well
...other automation http://mibuso.com/dlinfo.asp?FileID=8860
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions