(This post courtesy of Natalia Efimtseva)
Recently I worked with my colleague, Max Belugin, who is an expert in Dynamics. We were solving one interesting question—how you can activate and open a specific AX 2009 form/record from an external application or code.
You can use following approaches to open AX from an external environment:
Unfortunately, at the current moment .NET Business Connector doesn’t implement UI function, and thus it is not possible to open a specific AX form. But we can register AX32.EXE as a COM Object.
static void Connect(string args)
//find running Ax32.exe
dynamicsClient = (AxClientLib.DynamicsAxApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("Dynamics.Application");
//Launch new Ax32.exe
dynamicsClient = new AxClientLib.DynamicsAxApplicationClass();
if (dynamicsClient != null)
dynamicsClient.OpenMenuItem("DMO", "SalesTable", AxClientLib.AxMenuType.DisplayMenu);
Note: API doesn’t really call “form open,” but rather calls a Menu Item associated with a form. So you can call a specific form in this way, but not a specific record.
You can also run a command when an Application Object Server (AOS) instance starts (details).
You need to:
return new SysStartupCmdFormXX(s,parm);
class SysStartupCmdFormXX extends SysStartupCmd
args = new args(formstr(FormXX));
formRun = classFactory.formRunClass(args);
This guidance is taken from here—so you can implement your own desired behavior of AX.
AxPath is a protocol for activating Axapta forms. It does the following:
There is an external part named "URL handler," which takes an URL and places it in the queue. The queue is implemented using shared memory.
So, for example, when you click in the browser in URL like:
The following actions are performed:
With this method, you can open a specific form as well as a specific record.
This approach is based on alerts and notification capabilities of Axapta and named pipe protocols. External drill-down is the ability to initiate and use the AX drill-down feature from a program external to AX. This means you can open a specific form as well as a specific record.
Please refer this link for more details and source code for this method.