Technology

How to run an External Application within Dynamics NAV

Premanath Kumarage · Author
2 min read
A tablet displaying a CRM diagram with sales, service and marketing branches

Perhaps you may have inquired the possibility of executing an external program within Dynamics NAV due to many reasons such as;

Perhaps you may have inquired the possibility of executing an external program within Dynamics NAV due to many reasons such as;

1. To run an external application like Windows Calendar or Skype within NAV

2. To run a Crystal Report using a Icon available in NAV

Whatever the reason, concept for making this a reality would be as follows;

Initially you may have to find out the directory path where the executable file of the external application is located. For example, let's assume that you are in need of calling the windows Calendar within Payment Journal Screen. You can search the calc.exe file where it is located. Mostly this is available in the windows System32 directory. Therefore the relevant directory path could be defined as 'C:\WINDOWS\system32\calc.exe'. In CAL, you could call the Calendar Control by giving the following command;

SHELL('C:\WINDOWS\system32\calc.exe');

This can be achieved by placing an additional command button in the Payment Journal Screen. In the 'OnPush' trigger, once you place the following CAL code you can display the Windows Calendar on top of the Payment Journal Screen.

For example, if you want to direct your browser to open a particular Web Site, for example www.microsoft.com you can do it by placing the following command;

HYPERLINK('http://www.microsoft.com');

Let's say if you want to open a PDF document you could do it by giving the following command in CAL;

HYPERLINK('D:\MyDocuments\80042A_00.pdf');

In the above case, D:\MyDocuments\ is the directory path where the relevant PDF file is located and the 80042A_00.pdf' is the PDF file name.

For instance, if you want to call an External Program using the Menu Structure, you will be able to do it by giving a reference to Code Unit in the relevant Menu Object; in the 'OnRun' trigger of the Code unit you can place you CAL commands to call the external application as explained above.

Written by

Premanath Kumarage

Author

All insights →

Start here

Every piece here started as a client problem. Tell us yours.

A working session, not a sales call. Bring the process your current system fights you on, and we will tell you plainly what it would take to fix it.

Newsletter

One email a month. No filler.

Stay ahead with Microsoft Business Applications.
Insights, implementation advice and practical ideas to help your business get more from Microsoft technology.

By subscribing, you acknowledge MicroCloud 360’s Privacy Policy.