Using SHELL to run external applications
Just as external files can be opened from within NAV, so can external programs. This recipe will show you how to launch one of such applications.
How to do it...
Create a new codeunit from Object Designer.
Add the following code to the
OnRun
trigger:SHELL(ENVIRON('WINDIR') + '\notepad.exe');
Save and close the codeunit.
How it works...
The SHELL
command takes in a required string parameter representing the application to launch. There is an optional second parameter that will be passed as an argument to the application to be launched (not used here). This argument could represent a file to open or other flags incorporated into the program.
See also
Querying the registry