Pages

Wednesday, May 28, 2008

Using the AutoRun parameter to open a form in AX

In AX 4.0 and later you can use a start up parameter called AutoRun and combined with an XML file you can automate a lot of stuff in AX after starting the client.

The command line for AutoRun looks like this:
ax32.exe –StartupCmd=AutoRun_ c:\folder\filename.XML

The XML file holds descriptions of the commands to execute when the client is started.

The following is an example on how you can use this to open the CustTable form immediately after login.

First create the XML fle:

The exitWhenDone tag controls if AX should shut down after completing the tasks listed in the XML file. We don't want that in this case.

I'm saving the file as C:\OpenCustTable.XML.

And then you could create a specfic configuration file to use this start up parameter:

You could of course also just point to this at the command prompt.

That's it...

You can add as many commands as you want to the XML file, so you can really automate a lot of stuff.

The supported commands includes, amongst others:

  • Runnning installation, upgrade or configuration check lists
  • Loading license information
  • Compiling the application
  • Syncronize the database
  • Importing data
  • Importing XPO's
  • Running specific elements (like described on the above example)

Search the Administrator Help for "SysAutoRun" to read the included documentation.