-
Book Overview & Buying
-
Table Of Contents
Microsoft Dynamics NAV 7 Programming Cookbook - Second Edition
Opening an external program from NAV will not be a day-to-day activity for any NAV developer; however, this recipe can still be handy for a client with a special request to execute any other application from NAV. In the following recipe, we have taken Notepad as our external application.
Create a new codeunit from Object Designer.
Add the following global variables:
|
Name |
Type |
SubType |
|---|---|---|
|
|
|
|
Write the following code in the OnRun trigger of the codeunit:
CREATE(WshShell,FALSE,TRUE);
WshShell.Run('C:\Windows\notepad.exe');Save and close the codeunit.
As the standard SHELL command is not compatible with NAV RoleTailored client, we are using the class WshShell of Windows Script Host Object Model library. It provides multiple commands that are close to the standard shell command.
After creating an instance of our automation on the client machine, we have used the...
Change the font size
Change margin width
Change background colour