AX2012 Posting of Sales/Purchase orders parallelism settings

Doing some investigations regarding posting of sales orders (Picking lists, packing slips and invoices), I’ve noticed that in AX2012 there have been added the following parameters on Sales and Purchase to set the number of orders that needs to be passed per batch created during execution of posting the documents in batch having late selection set.

Number of documents in batch task

Suppose you have 31 Sales orders to post, AX will create 7 batch tasks, each containing 5 sales orders and the last one containing a single order. In case 0 or a lower number is specified 5 will be set automatically by the system.

All these batch tasks will be executed in parallel. Depending on the setting in the batch server configuration n batch tasks can be executed in parallel by the batch server.

Server configuration – Maximum batch thread

In this case only 8 thread will process the single batch tasks created (8 is the default).

Consider that these setting of the batch threads is not only used for sales/purchase order posting but for all batch tasks executed on the give AOS batch server in the time frame indicated.

See also the following link for additional documentation:

Optimizing AX Batch Performance – Batch Thread Configuration

Batch Server overview [AX 2012] – TechNet

Additional Information for AX2012 Form Letter Framework

Here some important classes that are used to post documents

  • The main entry point is the class FormLetterService with its post….() methods. You can see that on the different menu items (here an example of Picking list posting)

  • In addition for batch processing see the subclasses of class FormLetterBatchTask. Theses classes are used during batch processing to fork different batch tasks that will perform the multithreading operations.

    Here a short description of these classes for references.

    • FormLetterParmDataCreateDataBatchTask: Creates the parm table entries in late selection. There will be n batch tasks depending on the number of orders to post and on the setting of the “Number of documents in batch” explained before.
    • FormLetterParmDataRearrangeBatchTask: performs the rearrange of the parm tables in late selection. This batch task is executed single threaded on completion (Finish or Error) of the FormLetterParmDataCreateDataBatchTask tasks.
    • FormLetterServiceBatchTask: Performs the posting routines in batch execution. The execution is multithreaded. There will be n batch tasks created of these type depending on the parm tables to be posted and the parameter “Number of documents in batch”. The creation of these tasks will be done on termination of FormLetterParmDataRearrangeBatchTask
    • FormLetterServiceEndBatchTask: Performs final operation of posting. In this step depending on the settings of the print options the printing of the journals created is performed (This is a new feature of AX2012. I will cover it in a separate Blog Post). The execution of the task is single threaded.


You can use different AOS and tweak these parameters in order to improve performance during batch execution.

This entry was posted in Dynamics AX and tagged , , , , . Bookmark the permalink.

4 Responses to AX2012 Posting of Sales/Purchase orders parallelism settings

  1. Amit Kakkad says:

    I am posting sales order through AIF File adapter port.(Batch Job,Parallel processing) This is working fine with less orders. But when 100k orders are place through XML it is very slow and sometimes deadlock.(this have salestable and Salesline custom extension tables). It takes 12+ hours to post 600k ordersitems.

    Please help me to increase this performance.


    • tom says:

      Seems to me from the number of orders that you are talking about data migration (100k orders). In such a case I would suggest to use dixf framework. But also if this is the case i would recommend to avoid loading historic data.
      Only for curiosity In which timeframe do you get 100k orders in the system, i mean is this the amount of orders per day?

      • Amit Kakkad says:

        Thanks Tom for you response.

        These orders are monthly orders and we generate XML over network folder through .net console.
        AX AIF Asynchronous port picks it from Network folder which is quite slow.

        Still i am doing more analysis on this.

        Amit Kakkad

      • tom says:

        You should check with a sql expert why the deadlocks occurs and solve this before.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s