Hi,
I'm working on one of my first major Navision projects which is an ASCII interface from Navision to my companies core Warehouse Management System. I'm running this from a standard client, but the interface needs to run unattended at timed intervals.
The interface works, but I start getting problems with standard Navision validation - for instance if the interface tries to post a sales order but somebody hasn't set up something correctly - the standard Navision validation kicks in and pops up an error dialog, stopping the interface in it's tracks.
I'd really prefer to be able to trap these errors, write a message to a log somewhere then continue processing the next record.
Is there any easy way to do this?
Thanks in advance,
NickA.
0
Comments
What we do is identify, to the best of our abilities, what fields need to be filled out in the document.
When your interface runs, first run a batch routine that checks each of these fields. If something is not filled properly, do not post / insert this record but instead insert a record into a new table called 'Interface Errors' or something like that. We have a form running (based on the error table), that runs batch routines once every couple of minutes, and displays potential errors in the error table. The errors can be identified and corrected before the batch routine will insert the record / post the transaction.
My current project has this logic happening on two different fronts, integrating with a third party warehouse management system, which can feed us 10-20 records a minute (and we feed them a similar amount), and our add on which records different inventory and feeds Navision 50-100 records a minute, and automatically posts all of these records every 2 minutes. Out batch routines are written to avoid any potential errors during posting (optimistic of course!), but we have done this sort of integration for years and found that as long as you can identify what could go wrong with every single field you integrate with (not a small task but utterly important), then this type of integration can operate smoothly.
-A
I have implemented pre-validation as you describe but as you also say... it's a big job and difficult to find all the possible things that can go wrong - especially when the problem isn't just populating fields, it's whether a sales order/purchase order posting routine runs too.
Cheers.
This is the way how to catch errors without pop up window. You need only one thing - how to find what is wrong ;-) (there is no GetLastError or something)
see Form 6094
function CheckAndRunScheduler
line "IF RunObjectFromJobSched.RUN(JobSchedSetup) THEN BEGIN"
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
For example, one of our integrations is the picking of items for a sales invoice. We send to our third party the Sales Invoice number, and line number, Item Number (and description for information), and base quantity to be picked. They send us back the invoice number, line number, & item number. So we validate that the invoice, line and item match, and fill in the base quantity on the line.
There is no reason for them to send us back the description or bin location, or for us to send them the customer or pricing details. No need to send the units of measure, our master files and business logic removed this requirement. We scrutinized the datasets a great deal to be as simple as possible.
I can understand your frustration - beleive me we have been there, but what we have found (if this is encouraging), is that at the beginning of the project, the setup is incomplete and the users are novices. As the setup becomes more complete, and the users more experienced, the data will be more complete.
-A
'course it still won't hurt to try and pre-validate - a little more controlled that way.
Thanks,
NickA