Background Posting and Job Queue in Microsoft Dynamics NAV 2013

Do you or your customers have peak hours when all the sales orders and invoices need to be posted at the same time? Or do you have large batches of postings that need to be run without blocking other users? I bet the answer is yes. If so, then you may also have experienced your screen “freezing up” for several seconds –minutes even — until the order is processed. “Try again later” is also a well-known option.

To provide a better user experience and control of the posting, we have added the ability to post sales and purchase documents in the background. The user experience resembles that of printing of a document; the document to be printed is sent to the printer server and when the printer is ready, the document is processed. Typically, there is very little wait time – and the same goes for background posting.

It is important to note that when the posting is happening in the background, it uses a dedicated user session to ensure that the posted document is posted as being posted by the user. So it is still possible to track who did the posting.

The status of the posting can be identified in a few ways:

  1. Errors with the posting will always notify the user who initiated the posting. This is done through notifications. It is also possible to turn on notifications for successful jobs.
  2. For orders and invoices, we have introduced a job queue status column on the list pages. The same information can be found on the individual order and invoice pages.
  3. A new job queue part can be added to the role centers and it enables an overview of the job queue entries in progress.

Background posting uses the job queue, which has been enhanced in many ways in this version. In Microsoft Dynamics NAV 2013 the job queue can run either directly in the user session or it can be run through a dedicated NAS Service. Additional flexibility in the way the job queue can be set up has also been the focus of the release. Now, the job queue has the following capabilities:

  • It is possible to run many job queues with selection criteria per company.
  • You can have more than one job queue running on the same server at the same time.
  • The user’s jobs will run with the user’s permissions, so no special security setup is required.

We hope that these enhancements to the job queue combined with the background posting will open up more flexible usage of Microsoft Dynamics NAV and will lead to more efficient users and a better experience in peak hours.

Set up and Use Background Posting with Job Queue

In order to set up background posting, there are several areas that are worth highlighting:

  1. Background posting covers both the sales and the purchase side and has been implemented for the  following areas: Sales Order, Sales Invoice, Sales Credit Memos, Sales Return Order, Purchase Order, Purchase Invoices, Purchase Credit Memos and Purchase Return Order.
  2. The sales and the purchase sides are set up separately.
  3. Background posting covers the Post as well as the Post and Print scenarios. But remember to set up printers and NAS Service on the server correctly if Post and Print is activated.
  4. We recommend that you set up the job queue to run on a dedicated NAS Service, but for demoing purposes, it is easier to start the job queue on the existing session. This blog post will focus on the job queue run and not the NAS Service setup; see the product Help for considerations around the NAS service setup.

Set Up Background Posting

The first step is to set up the background posting, in this case, the sales side.

On the Sales & Receivables Setup page, a new FastTab has been added: Background Posting.

You activate background posting for sales documents by selecting the Post with Job Queue check box. To ensure that you have a dedicated job queue, you can provide a Job Queue Category Code. This routes the posting to the correct job queue.

The same applies for Post & Print – it is also set up if you select the check box.

The posting will create a job queue entry with the priority 1000. The priority field is used to determine the order of processing the job queue entries. By setting this to 1000, it is easier to allow other jobs to get in front of the queue.

Activate the Notify On Success check box if you want the user that posted the document to notified about the state of posting. There will be a notification attached to the posted document as well as a notification in the My Notifications part on the role center.

You can apply the same steps to the Purchases & Payables Setup page.

Set Up Job Queue

The next step is to set up a job queue to run the background posting.

In the job queue card, you create a new dedicated job queue. The Job Queue Category Filter resembles the filter set on the background posting setup. So this job queue will only run the job queue entries with the category Sales Post. The remaining fields in the General FastTab show the status of the job queue. In this case, the job has been started from the same session by the Start Job Queue action.

In the NAS Settings FastTab, it is possible to choose which NAS service the job queue must run on.

Note: The NAS Service needs to be restarted to pick up a new job queue.

Now, the application has been configured and it is possible to start posting.

Running Background Posting

Posting a sales order will create a job queue entry to be run on the dedicated job queue. This will execute the posting routine and if required, it will be sent to a printer. There is a visible difference in the posting routine, since the background posting will notify the user that the order has been sent for posting instead of showing the actual posting steps.

In the sales order list, it is possible to see the state of the posting. Showing the job queue status column on the list page will show the state of the posting.

If notification is turned on in the set up, it is very useful to add the Notes FactBox to the list page as well. This is really valuable in cases where the posting for some reason doesn’t finish.

In the case below, there is nothing to post which can be seen by the job queue status and the notification. Opening up the note shows the error message “There is nothing to post.”

It is also possible to see that there is something wrong in the posting on the role center. The My Notifications part shows any errors related to the posting. The same error can be found in the My Job Queue part.

The My Job Queue part also shows the progress of the jobs. Any job queue errors will be readable from the entry in the job queue. Failing job queue entries are displayed in red, while the job queue entries in line are displayed in black.