Share via


Automate the AX Checklist

Sometimes you stumble upon something that has been around for a long time but you never knew about, so when you do find out about it, it’s like making a whole new discovery. This is how I felt when I found out you could automate the checklist that must be completed after you install Dynamics AX.

This automation can be a real time-saver if you are doing multiple AX installations. For instance, if you’re doing AX development and you have separate test and dev environments that you update on a regular basis.

First off, I tested this in AX 2009, but the functionality is available in 4.0 as well. Essentially, you create an XML configuration file and then run AX from the command line and point to that configuration file. The configuration file contains elements that correspond to the steps in the checklist.

Here’s the config file that I used to test with. As you can see, this file specifies

· That the application should be compiled

· That the license file should be loaded from the specified path

· That the sample data should be imported from the specified path

· That the database should be synchronized

<?xml version="1.0" ?>

<AxaptaAutoRun version="4.0"

    logFile="c:\temp\config\autorunerrlog"

    exitWhenDone="true">

<CompileApplication crossReference="false"/>

<LicenseInformation file="c:\temp\config\

    AxsetupLicense.txt" />

<DataImport file="c:\temp\config\40ExtendedData1380.dat"/>

<Synchronize/>

</AxaptaAutoRun>

So the first thing you do is install Dynamics AX. Then, you write your config file with the settings you need. Then, run AX on the command line and specify the config file with this command:

Ax32.exe -StartupCmd=AutoRun_c:\Configuration.XML

My sample config file shows only a subset of what you can do with the config file. You can add users, add companies, run an XPO, run code from the AOT, etc. See the SysAutoRun Class help on MSDN for more options.

 

One final note - the config file above specifies version 4.0. That will still work with version 2009, as long as the version number specified is <= the product version number, it will not be a problem.