Dynamics AX Batch Job Dependencies - Avoid SQL Blocking


When running your business with Microsoft Dynamics AX, it requires the use of many batch jobs completing tasks in the background in order to minimize the need for manual intervention in the system. When these batches are setup as individual jobs, businesses run into issues from system blocking of tables to inefficient system management because of the timing of execution of jobs.

Batch Tasks with Conditions

As an example, let’s say you would like to run the inventory status change batch job to block inventory that isn't available. When this job finishes, it is the best time to execute the release of sales or transfer orders. As opposed to setting up both batch jobs independently and hoping the timing works out, these are setup as batch tasks with conditions ensuring that one job ends before another starts.

In a similar scenario, if your business uses a cleanup job for cases when a job ends in error, this tool is used to only trigger the cleanup job when the initial job ends in error.

Set-up Process:

  1. System Administration>Inquiries>Batch jobs

  2. On this page, click File>New or CTRL+N to create new.

  3. Give the Batch job a description, then click CTRL+S to save the record and activate the ability to View Tasks:

  4. In the Batch tasks screen click File>New or CTRL+N to create new.

  5. Give the first batch job in the sequence a description, choose the Company accounts for which it will run, and choose the Class name of the batch.

  6. Then click File>New or CTRL+N again to add the next batch in sequence.

    • Once you’ve added the next task(s) click F5 to refresh the screen and display the tasks in sequence as they were created, and to how they will execute.

  7. Now to create conditions within the job (in this example we are going to say we don’t want the Auto Release of Sales Orders to occur if the Inventory Status Change job ends in error), click the job for which you’d like to create a condition and click inside the Has conditions grid in the bottom of the screen and press CTRL+N for a new condition.

  8. The tasks that you choose from, from the above defined list of batch tasks, is in the drop down for the Task ID.

  9. Once the Task ID is chosen, choose the Expected Status that the following batch task is dependent on. In this example, we are choosing “Ended” to say that the Inventory Status Change job must be ended in order for the Release job to begin. The other choices are “Error,” like our example of a cleanup job that only runs when a batch ends in an error, or “Ended or Error” if you’d like the following job to start whether it ends or errors.

  10. In addition, you state in the Condition type if you have multiple conditions whether it hit Any of the conditions or must hit All of the conditions.

  • Batch jobs are setup as batch tasks in a sequence with conditions for the execution of the following job(s)
  • Creating batch job tasks in a sequence as opposed to as individual jobs help the system run more efficiently and prevent table blocking

If you have questions about Microsoft Dynamics AX batch job dependenciescontact us. 

As Vice President of Digital Transformation at Blue Horseshoe, Steve Shebuski guides businesses through their digital transformation journey. Steve has 20+ years of experience as a Program Manager/Design Lead/Project Manager implementing both Microsoft Dynamics AX / Dynamics 365 as well as tier I and tier II warehouse management and transportation software solutions. Steve's deep knowledge within the distribution industry and his innovative approach to solution architecture are the backbone of the solution implementation and deployment by Blue Horseshoe.

Learn How Others Have Improved Their Supply Chain Operations With Blue Horseshoe

Microsoft Extended Support for Dynamics AX 2012 R3: What's Next?

Read More

Blue Horseshoe Sponsors Ecommerce Operations Summit

Read More
Dynamics 365 ERP

Overcoming Cloud ERP Misconceptions: Your Guide to D365

Read More