How to retrieve run-time error?

denvit
Member Posts: 12
All expert guys
I would like to make a log table which contain run-time error log when error occur during runtime. For example when user use dataport to import invalid format, an error occured then write to error log table.
I would like to make a log table which contain run-time error log when error occur during runtime. For example when user use dataport to import invalid format, an error occured then write to error log table.
0
Comments
-
It is very hard work to do that, because you have no tool for catching error within C/SIDE... you can use some external library which will detect the error window, read the text and save it... I think that there is some posts about component, which is able to read the error message and close the error window. Search for it... it can be good start for you...0
-
First of All,
I wanna say thank you to both of you for your help. =D>
Waldo, Could you please show me a little example to use Navision Timer to catch an error message ? :idea:0 -
Well, actually, it's just useful when you have to use the timer for one reason or another. Not the other way around ... .
Else, it would be a bit of "dirty coding", i think. Something like this:
OnRun()
intInterval := 1000; // 1 second
myTimer.Interval := intInterval;
myTimer.Enabled := TRUE;
myTimer::Timer(Milliseconds : Integer)
myTimer.Enable := FALSE;
ExecuteMyCode;
myTimer::TimerError(ErrorString : Text[1024])
WriteLog(ErrorString);0 -
Isn't that event meant to catch an error raised by the timer itself? Wouldn't it be kind of silly to create a timer event just to catch the errors caused by that timer?
Or does that event catch errors caused elsewhere in the system?0 -
-
-
When you do this with a GUI client (that is, not NAS) then the user gets the error message box where he/she must click OK to proceed. After dealing with the message box the TimerError event runs.0
-
Or you can use external component to "click" the OK button on the error message (someone created it - I saw it somewhere there...) :-) but it is only workaround...0
-
Why do we accept this kind of behaviour from Navision anyway?
It would be so nice to have simple Exception Handling available within Navision.
for example
if NOT CodeUnit.RUN then
NavGetLastError()
<would be great >
How about using this community as a vehicle to directly address Navision Development at Microsoft regarding this (and possible other) issue(s)?
:-kPeter Wijntjes
MBS NAV Consultant0 -
pwijntjes wrote:Why do we accept this kind of behaviour from Navision anyway?0
-
-
I think error handling is on the top of all Navision developers. I know I used to mention it to anyone from Navision that came into our office, I mentioned it when I visited Denmark, and now I mention it every time when I speak to any MS Navision person. If I end up at the MS summit this year I will mention it again to anyone who will listen.
I have mentioned it so many times without results I have lost all faith that it will ever happen in C/AL. Once we get the big C# interface we're all rooting for, it'll be different. Untill then we'll have to keep debugging.0 -
-
Waldo
you mentioned that nothing will change in development environment, but in 4.0 SP1 they've added 3 new function to the API. FINDFIRST,FINDLAST,FINDRECORSET
I can still hope they'll add just something new in there.0 -
I wonder if those 'new' functions are anything like FIND('-'), FIND('+') and FIND('='). Wait a minute.... we already HAVE those... :-k0
-
Yes, we have, but it seems that they will be optimized for usage with MS SQL...0
-
How can i get exact error Text and Error Numbers from such type of Example??for example
if NOT CodeUnit.RUN then
NavGetLastError()
<would be great >
what i have to do in NavGetLastError() ????0 -
It was example, what will be nice to have in some next release of Navision... it is not real example of working code...0
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