Number of documents in batch task in AX 2012

Tucked away in the Accounts receivable (and Accounts payable) parameters, on the Update tab is a little parameter called ‘Number of documents in batch task’. Accounts receivable > Setup > Accounts receivable parameters > Update:

In the Hyper-V demo image this is set to 5, but if you run a batch job to post sales order invoices you’re often going to want to set this to a much larger figure.

Here’s the explanation. But to test this we need a reasonable number of sales orders. In an earlier post here, I explained how to import sales orders using the AIF in the demo Hyper-V image and I’ve used that to setup about 50 sales orders:


So next I’ll setup a batch job to post the invoices. Accounts receivable > Periodic > Sales Update > Invoice:


There are two parts to setting up a recurring batch job for sales invoicing. The first is to tick ‘Late selection’ and click on the ‘Select’ button to define the filter query of the sales orders you want to invoice. My criteria is very simple:


But a more realistic selection would be to invoice delivered sales order lines for those customers that don’t take an invoice with their goods.

The second part of the setup is to click on the Batch button:


Tick ‘Batch processing’; enter a Task description and Batch group; and use the Recurrence button to define when and how often the job runs. Incidentally in a multi-company environment I like to add the company name to the Task description – you’ll see in a minute that the company is shown on the Batch jobs inquiry form – but you can’t use it to filter for jobs in a specific company.

Back on the Posting invoice form, when you click OK you’ll get:


There are a couple of places you can view your batch jobs. Most people will head off to Systems administration > Inquires > Batch jobs, but you can also go to Home > Area page > Inquires > Batch jobs > My batch jobs:


Above I’ve waiting until the job has run, and I’ve clicked on ‘Batch job history’ and ‘View tasks’. Now I can see that the invoices were posted by ‘Multithread posting’ jobs. In this case because I’m posting 50 invoices and I’ve set my Number of documents in batch task to 5 I’ve got 10 of these tasks.

Now let’s change that parameter to a larger number (like 500) and try that again.

This time the batch job history shows that we only used one ‘Multithread posting’ job:


It also shows in this tiny example that the run time is a few seconds longer – but that’s not our experience in production systems posting hundreds of invoices. If you’re setting up batch jobs to post purchase orders, sales order picking lists or sales invoices you’re going to want to experiment with this parameter and select the setting which gives you the best performance.

Advertisements

4 thoughts on “Number of documents in batch task in AX 2012

  1. Very Nice Post Tim 🙂

    I have a problem in running the post invoices in batch. When I set recurrence. The job just runs but doesn’t post/ take any pending invoices. Would you be able to assist me here

    I am unable to attach the screenshot

    Thanks,
    Santhosh

    Like

  2. Hi Tim,

    I’m wondering what the base AX setup is for sending out Customer Invoices via a batch job. Is it:
    A) One email – One PDF – Many Invoice
    B) One email – Many PDFs – Many Invoices
    C) One Invoice – One PDF – One Invoice?

    Thanks,

    Sarah

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s