(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:
1. COM API
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.
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:
- Add your startup command to the switch in Classes\SysStartUpCmd\construct statement (given your startup statement is FormXX).
- Create a new class SysStartupCmdFormXX.
- Override the method applInit in this class.
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:
- It sits on a timer event and polls the queue.
- When it finds that there are some commands for the queue, it executes them.
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:
- Browser executes an URL handler with the URL as a command-line parameter.
- URL handler puts that URL into the queue.
- When the Tabax plugin polls the queue and detects that the URL is present, it opens the EmplTable menu item and navigates to the particular employee.
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.