AxClientLib COM interface of AX by using this we can open a form.
To try this,
Add the AX COM reference in solution explorer of visual studio
Sample code for calling sales table form.
using AxClientLib;
private void button1_Click(object sender, EventArgs e)
{
AxClientLib.DynamicsAxApplication dynamicsClient;
try
{
//find running Ax32.exe
dynamicsClient = (AxClientLib.DynamicsAxApplication)
System.Runtime.InteropServices.Marshal.GetActiveObject("Dynamics.Application");
}
catch
{
//Launch new Ax32.exe
dynamicsClient = new AxClientLib.DynamicsAxApplication();
}
if (dynamicsClient != null)
{
//Run form
dynamicsClient.OpenMenuItem("CEU", "SalesTable", AxClientLib.AxMenuType.DisplayMenu);
}
}
Thanks,
K. Arunsubramaniam
Hi K,
ReplyDeleteI'm facing a problem.
My visual studio doesn't shows me the Dynamics AX Client 1.0 Type Library in the COM. Do I have to download something, or find some DLL ?
Thanks
It comes with Dynamics AX Client, Please check/use the visual studio that is installed in AX client machine because COM is registered only in those machines.
ReplyDelete