Application Server as scheduler

lzrlzr Member Posts: 264
I am currently using Navision Application Server for scheduling a report. The report sometimes gives messages and confirms. When it gives some user output I want to indicate and error. To do this I am using a codeunit which runs the form. when the codeunit returns false I mail myself an error report.
However it seems like it is giving me error message even though all is right..

Anyone have any better idea on how to check for errors?
Navision developer

Comments

  • kinekine Member Posts: 12,562
    Of course, the problem can be the confirm...:-)

    In this way you can catch only error message or testfield errors etc. Not messages... and of course, you are not able to use Dialogs. Check the eventlog for more info why you have error...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • pduckpduck Member Posts: 147
    use the ntimer.dll to start the process ... it has an error-event where you can catch errors. but in fact it would be better to rewirte the report using the GUIALLOWED() function to make it nas-compatible.
    because you can only catch errors your report will always fail. the only advantage is that your nas is continuing and not stopping.
  • DenSterDenSter Member Posts: 8,307
    It's a good idea to put the call in a codeunit and use the return value of that codeunit to determine if it ran successfully. The thing is though, that if that object generates a message or a dialog, you will still get an event in your log, because NAS can't handle screen output. The way to suppress that is to use the GUIALLOWED method, like pduck said.

    So you would program a default value if there is no GUI, like this:
    IF GUIALLOWED THEN BEGIN
      SomeBoolean := CONFIRM('Do you want to continue?',TRUE));
    END ELSE BEGIN
      SomeBoolean := TRUE;
    END;
    
    This way, if the object is run by NAS, the boolean is set to a value you choose, and there will be no screen input/output.

    I'm doing this without Navision, so the GUIALLOWED may be slightly different, but check F1 help.
  • lzrlzr Member Posts: 264
    Ok, thanks for your input! I do not really care what kind of problem there might be, however I need to know there is one so I can fix it manually :)

    I think I will use a variable in my report which will indicate that it ran succesfully or not. Then fetch the variable from my codeunit after a while.
    Navision developer
Sign In or Register to comment.