Get in touch

AX Client - Run code

Runs a job, static class method or a menu item of an AX 2009/2012 environment

TopicWork with AX client (AX 2009/2012)
CategoryUtility
Special features
  • Runs a job
  • Runs a static class method with parameters
  • Runs a menu item.
    • Action
    • Display
    • Output
Microsoft documentationhttps://msdn.microsoft.com/en-us/library/sysautorun.execrun.aspx

Parameters

ParameterTypeRequiredDefaultExample
Run modeHow should the step be executed? Possible values are "Direct", or "Batch.PicklistTrueDirect—
Object typeWhat object type should be run? Possible values are "Job", "Static class method", "Menu item". Please note that Object type "Job" is not supported by all versions of Microsoft Dynamics AX.PicklistTrueJob—
Job nameSpecifies the name of the job to execute.Depends on: Only visible if Object type is "Job"StringTrue—MyJob
Class nameSpecifies the name of the class to run.Depends on: Only visible if Object type is "Static class method"StringTrue—MyClass
Method nameSpecifies the name of the static method to execute. If empty "main" is used.Depends on: Only visible if Object type is "Static class method"StringFalse—MyStaticMethod
ParametersSpecify parameters which should be added.Depends on: Only visible if Object type is "Static class method"StringFalse—'MyString', 100
Menu item typeWhat menu item type should be run? Possible values are "Action", "Display", or "Output".Depends on: Only visible if Object type is "Menu item"PicklistTrueActionMyActionMenuItem
Client config file path (.axc)The file path of the client configuration file.Depends on: Only visible if Run mode is "Direct"File pathTrue—$/Microsoft Dynamics AX (Test)/Client.axc
Log file path (*.log)The file path to save the log file to.Depends on: Only visible if Run mode is "Direct"File pathTrue—$/Microsoft Dynamics AX (Test)/MyAutorunLogFile.log
Layer nameSpecifies which layer to open in the AOT.Depends on: Only visible if Run mode is "Direct"StringFalse—VAR
Layer codeSpecifies the developer license code for developer options.Depends on: Only visible if Run mode is "Direct"StringFalse—SDSA43432DSADSADAS
Model nameThe "current model" is the model where all new AOT elements are created in.Depends on: Only visible if Run mode is "Direct"StringFalse—MyModel
Max wait time (min)The number of minutes to wait before failing the step.Depends on: Only visible if Run mode is "Direct"IntegerFalse120—
AutoRun file path (*.xml)The autorun file to append the build step to.Depends on: Only visible if Run mode is "Batch"File pathTrue—$/Microsoft Dynamics AX (Test)/MyAutorunFile.xml

Frequently asked questions

Error message "Unsupported type job specified for run command."

The Object type "Job" is not supported by all version of Microsoft Dynamics AX. If so in your installation, you have to do some customization to support it. Maybe you could copy the required code in "SysAutoRun.execRun" from Microsoft Dynamics AX 2012 R3. Please see Microsoft site for more informations.