Pages

Saturday, June 13, 2015

Configuring NAS to schedule Batch Jobs in NAV 2013 R2

The NAS (NAV Application Server) is used and configured to run the batch jobs and processes in background which need recurring execution.


To Schedule Execution of a Batch in NAV 2013 R2, we need to take help of Job Queue.





Departments > Administration > Application Setup > Job Queue



Now we see 4 Lists Here, We will analyse them 1 by 1 in the way they need to be used to schedule the batch job.

Step 1. Create a Job Queue Category


Expand the Job Queue Categories List > Click New > Create a Category



- Enter ('TEST' as) the Code.
- Enter a Description.
- Click OK.


Step 2. Second step will be to create a Job Queue


Expand the Job Queues List > Click New > Create a Job Queue Card.




- Enter ('TEST JQ' as) the Code.
- Enter a Description.
- Select the "Job Queue Category Filter" ('TEST') created in STEP 1, we are giving Category filter with our Job Queue to link Job Queue Entry with the Job Queue. To understand this lets go to the Next Step. 
- Set "Start Automatically From NAS" to True in the NAS Settings Tab (We will know the reason in the steps to come).
- Click OK.

Step 3. Create a Job Queue Entry


Expand the Job Queue Entries List > Click New > Create a Job Queue Entry




- Select the "Object Type to Run". It can be either Codeunit or Report.
- Select an "Object ID to Run".
- Select the "Job Queue Category Code" ('TEST') created in STEP 1. This will complete the Link and connect our Job Queue Entry with Job Queue.
- In the Recurrence Tab, we can select the Days on which we want our Job Queue to Execute. 
- Set the "No. of Minutes between Run" (to '1' for a test run). If its Default '0', it will run once a day.
- Click OK.

Now we will have a Job Queue Entry created as shown in below snapshot. 

We need to Change the Status from "On Hold" >>> to >>> "Ready"



By Clicking on "Set Status to Ready" Action we modify the entry as shown below.



Step 4. Configure NAS Services in NAV Server


> Open NAV Administration, Expand the General Tab. Enter the Company name on which the NAS Service will process in "Services Default Company" as shown below,


> Check the "Startup Codeunit" in NAS Settings Tab must be '450' which the Codeunit for "Job Queue - NAS Start Up".


> Click Save.
> Now Restart the Instance after making changes.

Once the services have restarted, We will see the "Started" field is set to True by NAS Services.



The Job Queue will now Start executing itself. It can be seen in the "Job Queue Log Entries".



As we set the "No. of Minutes between Run" to '1' in Step 3, Therefore the Log entries.


That's all folks. 
Post your comments & queries I will be very glad to answer them.

Cheers, 
Ishwar Sharma



To Access and Download the Objects used to for Batch process. Follow the below Link :

No comments:

Post a Comment