As is well known, the Job Queue functionality of NAV is only intended to be used from an application server. Though this module is part of BE and AM edition, it can not be used from the scratch from within a GUI NAV Client. But unfortunately some jobs will not work when they are started from an application server service. For example it is not possible to run dataports or use the HYPERLINK command from application server. Furthermore, some automation servers will not work. For that reason, it is sometimes useful to do a small customization, which enables the Job Queue functionality to be used from a self starting NAV client running on a server.
Image may be NSFW.
Clik here to view.
There exists already a similar functionality for doing background jobs from within a normal NAV client, namely the E-Mail logging functionality which is launched in the LogInStart function of codeunit 1:
Image may be NSFW.
Clik here to view.
So it is only straightforward to implement a similar functionality for the job queue. At first we define a “Job Queue User ID” in the “Job Queue Setup” table (don’t forget to provide validate and lookup functionality for the field as you can find in table “Marketing Setup”):
Image may be NSFW.
Clik here to view.
It is advantegeous to choose a windows login as “Job Queue User ID”, because a windows login can be configured to start a NAV client automatically, when windows is started.
All what is left is to put some code into codeunit 1 in order to start the job queue scheduler, when the “Job Queue User ID” logs in:
Image may be NSFW.
Clik here to view.
So every time the “Job Queue User” logs in, the global scheduler codeunit is started in the background to check periodically for jobs to perform. Don’t forget to supply the “Job Queue User” with appropriate rights to perform his jobs. But as the NAV client session is always accesible from the console, the user should not have too much rights. For example it is often unnecessary to grant rights to any forms, object designer, etc….