Thursday, 13 August 2015

Creating a service AIF in Microsoft Dynamics AX 2012

1    1.Create a new service in Services node.
2.       Go the properties of that service node and set the service class that you are intended to.
3.       Now drag and drop the required methods in the operations group of the service node.
4.       Create a new Service Group and add the created service into this group.
5.       Now right click on the newly created service group and deploy it!.
6.       Go to the AX rich client and go to the System Administration module and Click on Service and           Application Integration Framework >> Inbound ports >> refresh the list and you will find your           service here >> now select your service and click “Activate”.

Monday, 3 August 2015

Export a shared/private project through x++ code in Microsoft Dynamics AX 2012

static void exportingtoxpos(Args _args)
{
TreeNode treeNode;
FileIoPermission perm;
#define.ExportFile(@"D:\TestProject.xpo")
#define.ExportMode("w")

perm = new FileIoPermission(#ExportFile, #ExportMode);
if (perm == null)
  {
        return;
  }

perm.assert();

treeNode = TreeNode::findNode(@"\Projects\private\SSRSReports"); //path of project either private                                                                                                                     or shared and project name
if (treeNode != null)
  {
      // BP deviation documented.
      treeNode.treeNodeExport(#ExportFile);
  }

CodeAccessPermission::revertAssert();
}