Hello all,
I am working as a developer and my company is using Nav 3.7 with a 3.1 database. We have something similar to Job Scheduler that we leave running constantly. It checks a table called Dispatch Control every 60 seconds for a job that it must perform. If it finds one, it runs a corresponding report or codeunit.
The problem is this. Occasionally a part will come in from the commerce portal that is not in Navision. If that happens, Navision throws an error and we have to restart navision, add the item, then restart the Dispatcher. The same thing happens if there is a printer that runs out of paper or gets a paper jam. The whole process stops, and navision sets quiet with an error message displayed and when everyone comes in in the morning, we have to re-run the entire process.
Job scheduler does something similar however, it spits out an error message and then marks the codeunit to re-run at a later time. I would like to do something similar as our current fault tolerance is not acceptable.
My question is this, is there any way that I can trap errors in navision, spit out a report and then remove the modal error box and continue processing, similar to the way Job Scheduler does it?
Thanks for any help or comments you can give, even if it's not a solution.
No one loves you like the one who created you...0
Comments
If an error occurs during checking, have the record be inserted into another table, then delete the record so the process won't stop.
After that, the user just need to go to the new table with problem records and address them one by one.
Basically, something like:
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
The structure is this...
Form Dispatcher has timer on 60 seconds....
->
Reads Table Dispatch Control and if it finds
a line that has a time/date stamp later than
current then execute that report/codeunit/dataport.
->
Writes to a Table Dispatch Log before and after
codeunit/report/dataport runs.
If it runs into an error in any of these, it breaks.
There are roughly 20 units called by dispatcher and each unit is several hundred lines of code. I could check all the states of data called in the codeunit before calling the codeunit, but that would be an arduous task to write, and it wouldn't stop things like printer errors.
Basically I need the ability to do a :
Try
Run Codeunit
Catch
Write to Error Log
Reset Dispatch Control Table entry for next run date/time
End Catch
Run Next Codeunit...
But I don't think there is a try/catch in navision?
Thanks for any help anyone can give...
No one loves you like the one who created you...
What we did for a client was to run the error log form after the process is complete. But instead of a form, you can use a report.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
If CODEUNIT.RUN() THEN BEGIN
END ELSE BEGIN
END;
Should work. My problem was not processing an error log, but getting an error log to print when any kind of error occured within a codeunit/report/dataport without the system just hanging on the error.
I will update the post when I have it implemented and working, otherwise I will write a ranting post after two days of it not working
Thanks again for the help BL.
No one loves you like the one who created you...
http://www.BiloBeauty.com
http://www.autismspeaks.org
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No one loves you like the one who created you...
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No one loves you like the one who created you...