Export (0) Print
Expand All

How to: Import a Class on Startup [AX 2012]

Updated: September 13, 2011

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

You can import a class, and execute methods within it without user interaction by starting Microsoft Dynamics AX from the command line with an XML file as input parameter. The XML file specifies the class and methods to use. The result of importing and executing is written to a log file or shown to the user in Infolog.

Executing with no user interaction is useful for any automation of customer tasks, in particular during the test phase.

  1. On the Microsoft Dynamics AX client computer, create an XML file.

  2. Add tags to the XML file specifying:

    • The Microsoft Dynamics AX version.

    • The name and location of the log file.

    • The XPO file that contains the class to import.

    • The method to run.

      NoteNote

      The XML file syntax is described in the documentation for the SysAutoRun Class.

  3. Open a command line window and type

    ax32.exe -StartupCmd=AutoRun_ c:\folder\filename .XML

The following example shows an XML file that can be used to import data silently.

<AxaptaAutoRun version="6.0" logFile="AXAutoCreateClass.log">
  <XpoImport file="d:\share\CreateClass.xpo" />
  <Run type="class" name="CreateClass" method="main" />
</AxaptaAutoRun>

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show:
© 2014 Microsoft