Suppress/redirect error messages

NickANickA Member Posts: 32
edited 2004-02-18 in Navision Attain
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.

Comments

  • awarnawarn Member Posts: 261
    We have encountered this type of issue, and although have no solution, have a pretty good workaround.

    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
  • NickANickA Member Posts: 32
    Ah, that's a shame.

    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.
  • kinekine Member Posts: 12,562
    If you look into objects used with service scheduling management, you can see, that if you call codeunit run function and read his return value ( ret := c.run;), if there is error in the codeunit risen, message will not popup but return value will be false!!! If all is ok codeunit return true!

    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"
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • awarnawarn Member Posts: 261
    Yea, it helps to try and keep the integration as simple as possible, try and keep the information that is flowing to a minimum.

    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
  • NickANickA Member Posts: 32
    To kine - :D Great! If it errors I'll just log a general message that'll tell them to try posting manually.

    'course it still won't hurt to try and pre-validate - a little more controlled that way.

    Thanks,
    NickA
Sign In or Register to comment.