Monday 11 October 2010

Microsoft Dynamics AX Call a Static Method from C#.Net X++

Install the .Net Business Connector is installed. If not, it can be using the AX Client Setup.

Add a reference to the Business Connector DLL "C:\Program Files\Microsoft Dynamics AX\50\Client\Bin\Microsoft.Dynamics.BusinessConnectorNet.dll"

Access the method as follows;

using Connector = Microsoft.Dynamics.BusinessConnectorNet;

Connector.Axapta axInstance;
axInstance = new Connector.Axapta();axInstance.LogonAs("Username", "Domain", null, null, null, null, "AXShortcut.axc");
returnVal = (string)ax.CallStaticClassMethod("MyAXClass", "MyAXMethod", "MyArgs");

The (string)
cast of the return value could change.

No comments:

Post a Comment

Thanks for the feedback!