SysAutoRun Class

Enables system administrators to configure Microsoft Dynamics AX by supplying the Microsoft Dynamics AX client with an .xml file that contains configuration commands. The SysAutoRun class can also be used for testing purposes and to run custom code when Microsoft Dynamics AX is started.

Note

To use the SysAutoRun configuration .xml file, see the Remarks section later in this topic.


class SysAutoRun

Run On

Client

Methods

Method

Description

cancelTimeOut

Cancels a previous method call to the Object::setTimeOut Method. (Inherited from Object.)

equal

Determines whether the specified object is equal to the current one. (Inherited from Object.)

execAdjustGlobalTypes

Allows modification of properties on global data types in Microsoft Dynamics AX.

execCheckList

Checks whether the installation checklist or the upgrade checklist has been completed, and then starts them if they are not complete.

execCommand

Invokes other command methods in the SysAutoRun class.

execCompanyAccounts

Enables the creation of Microsoft Dynamics AX company accounts.

execCompileApplication

Compiles the entire Microsoft Dynamics AX application or a specified portion of the Application Object Tree (AOT).

execConfiguration

Enables modification of the default Microsoft Dynamics AX configuration keys.

execDataImport

Imports data from a .dat file into a company account.

execHomePageProfileImport

execLicenseInformation

Loads the license file for Microsoft Dynamics AX.

execPostSynchronizeDataUpgrade

Performs synchronization after a data upgrade.

execPreSynchronizeDataUpgrade

Performs synchronization prior to a data upgrade.

execPreventCheckList

Prevents the display of all checklists that run when Microsoft Dynamics AX starts.

execRun

Enables you to run an X++ method or menu item when Microsoft Dynamics AX is started.

execRunXml

Enables you to reference and run other SysAutoRun configuration .xml files.

execSQLInstall

Sets up the Oracle database for use with Microsoft Dynamics AX.

execStatistics

Determines whether Oracle update statistics are calculated. If this feature is enabled, it updates the statistics of the indexes used in Microsoft Dynamics AX.

execSynchronize

Synchronizes all the Microsoft Dynamics AX table definitions in the Application Object Tree (AOT) with those in the database server.

execSyncServiceUserAccount

Create the synchronization service admin user account.

execUserOptions

Enables or disables basic user options. These options are the same as those available on the Confirmation tab of the Tools > Options form. It is possible to specify another user to copy the settings from.

execute

execWorkflowExecutionUserAccount

Create the workflow execution user account.

execWorkflowSystemUserAccount

Create the workflow system user account.

execXpoImport

Enables X++ objects to be imported from .xpo files.

getAttributeValue

getTimeOutTimerHandle

Returns the timer handle for the object. (Inherited from Object.)

handle

Retrieves the handle of the class of the object. (Inherited from Object.)

logError

logInfo

logSectionPrefix

logSectionSuffix

logSectionSuffixEmpty

logWarning

markCheckListItem

new

Creates a new instance of the SysAutoRun class.

notify

Releases the hold on an object that has called a wait method on this object. (Inherited from Object.)

notifyAll

Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.)

objectOnServer

Determines whether the object is on a server. (Inherited from Object.)

owner

Returns the instance that owns the object. (Inherited from Object.)

parmCwd

Gets or sets the Cwd parameter.

parmExitWhenDone

Gets or sets the ExitWhenDone parameter.

parmLogFile

Gets or sets the LogFile parameter.

parmLogToScreen

Gets or sets the LogToScreen parameter.

setStorageElement

setTimeOut

Sets up the scheduled execution of a specified method. (Inherited from Object.)

toString

Returns a string that represents the current object. (Inherited from Object.)

usageCount

Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.)

wait

Pauses a process. (Inherited from Object.)

xml

Returns an XML string that represents the current object. (Inherited from Object.)

::construct

Creates a new SysAutoRun object by reading an .xml file.

::fileExistsServer

Remarks

Configure Microsoft Dynamics AX by using a SysAutoRun configuration XML file. This XML file contains elements that correspond to each step in the checklist that appears after you first install Microsoft Dynamics AX. Using this file as a startup parameter enables you to perform unattended automation of the checklist.

  1. Create an .xml file, for example, C:\Configuration.xml.

  2. Add a root tag that specifies the Microsoft Dynamics AX version.

    You can also use the root tag to specify the path to a log file, how log information should be presented, and whether Microsoft Dynamics AX should be closed after the configuration file is run.

  3. Add one or more tags that specify the task(s) that you want to run and the attributes needed for these tasks.

  4. Run ax32.exe and pass the configuration file as a parameter:

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

  5. Wait while the system runs the requested tasks.

  6. Check the log file for any errors.

  7. Start using Microsoft Dynamics AX.

The root tag for the configuration file is called AxaptaAutoRun. For a description of the version, log file and other options, see the parmCwd, parmExitWhenDone, parmLogFile, and parmLogToScreen methods.

The tags mentioned in step 3 are shown in the following example, and described in the Help topics for the SysAutoRunexec* methods. For a list of these methods, see the previous Methods table. Each tag specifies a single task. Some tags have attributes that supply additional parameters, such as a name or the path to a file.

Example

The following example shows the contents of a SysAutoRun configuration file.

<?xml version="1.0" ?>
<AxaptaAutoRun 
    exitWhenDone="false" 
    version="4.0" 
    logFile="D:\Axapta\AxaptaAutorun.log">
 <CompileApplication crossReference="false" /> 
 <LicenseInformation file="d:\axapta\license.txt" /> 
 <Configuration>
    <ConfigurationKey name="SysUserLog" enabled="true" />
    <ConfigurationKey name="PBA_AdvancedProductBuilder" 
        enabled="false" />
 </Configuration>
 <AdjustGlobalTypes>
    <AccountNum length="24" adjustRight="false" />
    <AmountMst displayLength="12" decimals="10" />
 </AdjustGlobalTypes>
 <Synchronize /> 
 <UpdateCrossReference /> 
 <UserGroups>
    <UserGroup id="sales" name="Sales force" />
 </UserGroups>
 <Users>
  <User id="MaryN"
      name="Mary North"
      email="someone@example.com"
      language="en-us"
      companyId="ex"
      osAccount="MaryN"/>
 </Users> 
 <CompanyAccounts>
     <Company id="NWT" name="Northwind Traders" overwrite="true" />
 </CompanyAccounts> 
 <XpoImport 
     file="d:\axapta\setup\XPO\Logger\Enum_TestLogEntryType.xpo" /> 
 <DataImport companyId="BVT" file="d:\axapta\basedata.dat" /> 
 <Run type="class" name="RunMyTests" method="main" /> 
 <PreventCheckList /> 
</AxaptaAutoRun>

See Also

SysStartupCmdAutoRun Class