How to Set Up Job Queue in Microsoft Dynamics NAV 5.0

The Job Queue is handling the order of batch jobs and code units that are setup to run at a given time. The application server reads from the job queue and determines what job to run next. Several parameters can be set up to determine this.

Prerequisites

Before you can setup and execute a job queue you will need to:

1.Install Microsoft Dynamics NAV 5.0

2.Install Microsoft Dynamics NAV Application Server

a.Make sure that the NAV Application Server service is a user registered in NAV and on the SQL Server, if SQL Server is the database server for NAV

Create a Job Queue Entry

The Job Queue Entry Card window in figure x-1 shows the actual job. It can either be a single instance or a re-occurring job. Therefore there are two tabs in this window: General and Recurrence.

Via the Job Queue Entry Card it is possible to setup a limitation for attempts to start a specific job. If a limitation is needed a value should be entered in the Maximum No. of Attempts field. The field No. of Attempts to Run will list how many times the current job has been attempted to run. Also the time intervals as to when the job should try to start are setup here in the Earliest Start Date/Time field.

Figure x-1: Job Queue Entry Card

The different Status codes are:

·Ready

·On hold

·In process

·Error

If the job is performed successfully it will be removed from the list in the Job Queue EntriesCard window unless it is a recurring job.

The Recurrence tab on the Job Queue Entry Card is used to setup recurrence of each Job Queue Entry.

The Job Queue Entry administrator should, as a good practice; set the Job Queue to On Hold before changing the different settings in the Job Queue Entry Card. Once the Job Queue Entry administrator is done with the setup of a Job Queue Entry the Reset Status will activate the job.

Figure x-2: Job Queue Entry Card – Reset status

On the recurrence tab, the jobs can be set to be scheduled only on specific week days.

The Job Queue Entries List will list all current job queues; the window is displayed in figure x-3.Go to the Administration menu - Application Setup - Job Queue and then click Job Queue Entries and press F5 to get the Job Queue Entry List.

Figure x-3: Job Queue Entry List

The Job Queue Entry List displays the Status of the job, the User ID of the user that initiated the job in addition to the Object ID in question.If the status is ready then the application server can run the scheduled job. The application server will run the listed jobs based on entries in fields: Earliest Start Date/Time and Priority. While the job is running, it will be listed in the Job Queue Processes window figure x-4.

Figure x-4: Job Queue Processes window

The Job Queue Log Entries displays a list of jobs which already have been running.

Figure x-5: Job Queue Log Entries

The Job Queue Log Entries will also display any error messages for Job Queue Entries that went wrong. Each line represents a Job Queue Entry. If the job ended with errors during the expedition of the Job Queue Entries the error message will be listed as the last column in the Job Queue Log Entries. The error message limitation is 1000 characters.

Activate the Job Queue

The Job Queue function is activated or deactivated in the Job Queue Setup window. Select the field Job Queue Active to make the job queue active.

Figure x-6: The Job Queue Setup

You should now be able to set up the Job Queue for CodeUnits and Reports in Microsoft Dynamics NAV 5.0.

I would like to add a special thanks to Rikke Lassen and Bardur Knudsen for making this blog a reality.

Martin NielanderProgram Manager

This posting is provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.