Calling system commands from CAL code

I know that system commands can be called from Navision by running them from a menu option or button by setting the PushAction property to RunSystem and setting the RunCommand property to call the program that we need to run. For example, user wants to use the software SmartSketch to print the drawing of a BOM. The command is: "c:\program files\smartsketch\smartsketch.exe /p /q " “\serverp\hp4000nofc” /c1 “test2.igr” Can this be done from within CAL code instead of the properties of the menu option/button? I have a button called Print Shop Documents. The code in the OnPush trigger of the button prints a couple of documents by running Navision reports. I need it to, after printing the reports, call Smartsketch to print the drawing that is saved in a file. The file name(with the path) should be a variable. Thanks. Pari Somasundaram

You could use the “shell” command from within code.

Hi, You can use the CAL code mentioned below SHELL("c:\program files\smartsketch\smartsketch.exe /p /q " “\serverp\hp4000nofc” /c1 “test2.igr”);

Or by using Automation control. Not all applications are written to allow this. This is where you can make an internal link from your code unit to the application and then control that application from Navision. Regards Graham