Terminating Navision

jksjks Member Posts: 277
Hi all,

Is there any way by which i can terminate i.e exit from Navision if error occurs?
e.g

if returnvalue<>0 then
// some code to terminate navision application

Thanks for any help.

Comments

  • SunsetSunset Member Posts: 201
    Not using only Navision. There are a couple different applikations that will terminate programs in windows. So you could have Navision write to a file if an error occurs, and then have the applikation read the file and terminate navision
    Don't just take my word for it, test it yourself
  • jksjks Member Posts: 277
    all these applications comes with OS or any third party application which needs to be downloaded?

    can you please give the name of some of such application?
  • themavethemave Member Posts: 1,058
    if you go to the database session form in Navision 4.0 you can press the F4 - Delete and close a session, if you can do it there manually you should be able to do it pragmatically. But I am just an end user without developer license so I can not help any more.

    My guess is you would need to add to your code, a search for your session, and a delete comand.

    just a guess though.
  • Morten_SolbergMorten_Solberg Member Posts: 24
    Variable:
    WshShell Automation 'Windows Script Host Object Model'.WshShell

    if returnvalue<>0 then begin
    CREATE(WshShell);
    WshShell.SendKeys('%{F4}'); //Alt+F4
    end;
  • DeSpDeSp Member Posts: 105
    Sending Alt+F4 is not a complete solution as the window asking for saving ZUP file can appear and hold Navision client running. So you'll have to send it twice :). It will be better if you will send a ' taskkill' command or run a custom application which will terminate Navision client process.

    Best regards.
    Nil desperandum
Sign In or Register to comment.