Create a batch job
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
A batch job is a group of tasks that are submitted to an AOS instance for automatic processing.
The tasks in a batch job can run sequentially or simultaneously. In addition, you can create dependencies between one task and another. This means that you can set up a different sequence of tasks, depending on whether an earlier task succeeds or fails.
Batch jobs are run by using the security credentials of the user who created the job.
Batch jobs run on a per-partition basis. A system administrator can create, change, and view the history for the batch jobs in each partition. The batch job administration forms show information about batch jobs only for the partition to which you are currently logged on.
Create a batch job
Click System administration > Inquiries > Batch jobs > Batch jobs.
Press CTRL+N to create a new batch job.
Enter a description for the batch job.
In the Scheduled start date/time field, enter the date and time at which you want the batch job to run. If you do not enter a date and time, the current date and time will be entered for you.
Press CTRL+S to save the job.
To set up a recurring job, click the Recurrence button, and enter a range and pattern for the recurrence.
To set up an alert for the batch job, click the Alerts button, and select alert options.
Huomautus
Alerts will always be sent if the Save job to history option on the General tab is set to Always. If this option is set to Errors only, alerts will be sent only if the job was unsuccessful. If this option is set to Never, alerts will not be sent.
Add a task to a batch job
In the Batch jobs form, click the View tasks button.
Press CTRL+N to create a new task.
Enter a description for the batch task.
In the Company accounts field, select the company database in which the task will run.
In the Class name field, select the process that you want the task to run. (Classes appear in the list only if the CanGoBatchJournal property is enabled.)
Tärkeä
Some classes are designated to run on the client. You can add client tasks to a batch job. However, you must run client tasks manually by using the Set up batch processing form. For more information, see Asiakas- ja yksityisen erätyön tehtävien suorittaminen.
In Microsoft Dynamics AX 2012, the list of batch classes is only updated when the client is started. For newly-added classes to be reflected in the list of classes, restart the client.
If appropriate, select a batch group for the task.
Client tasks must be assigned to a batch group, and they are automatically assigned to the default batch group (also known as the Empty batch group).
Press CTRL+S to save the task.
To make the selected task dependent on another task in the job, click in the Has conditions grid, and follow these steps.
Press CTRL+N to create a new condition.
Select the task ID of the parent task.
Select the status that the parent task must reach before the dependent task can run.
Press CTRL+S to save the condition.
If you have entered more than one condition, and if all conditions must be met before the dependent task can run, select a condition type of All. Select a condition type of Any if the dependent task can run after any of the conditions has been met.
Choose how to handle task failures. To ignore the failure of a specific task, on the General tab, mark the Ignore task failure option for that task. If this option is marked, the failure of the task will not cause the job to fail. You can also use the Maximum retries field to specify the number of times that a task should be retried before it is considered to have failed.