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.