Running Job Queue through NAV Web service for Unlimited Companies
I had posted on mibuso a while back on how to use two NAS instances to run job queue for unlimited amount of companies. Here is the link:
viewtopic.php?f=7&t=22633. You had to purchase an additional NAS user license in order to use it. Dynamics NAV 2009 comes with web service, and you can publish any Code unit or Page by default. You will need to purchase one user but for webservice, but it much cheaper. In this blog, I will show you how to setup JOB QUEUE to schedule to run jobs across companies. The advantages of using Web Services is that you can run multiple jobs at the same time for multiple companies. What I've experienced with NAV 2009 Web Service is that once you call a web service function, you can disconnect and Service Tier will finish the job and commit the transaction.
In addition you don't have to modify any processing/posting jobs that have dialog windows displayed. The Service tier simply ignores them. For example you can run adjust cost report without modifying any objects from Job queue. In addition, the solution I've created does not modify any existing objects!!!
This fob file is uploaded as support for the thread
Job Queue through NAV Webservice for mulitple Companies.
Object is Codeunit 50000.
http://www.mibuso.com/dlinfo.asp?FileID=1039
Discuss this download here.
Comments
http://mibuso.com/blogs/ara3n/2009/01/28/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I am impressed with your work and efforts to help everyone!
I have a NAV 2017 installation and I would like to use your functionality of Job Queue for multiple companies. I suppose it's possible right?
I think the link that defines the required steps is broken, can be? Please point to the right link, or if I am looking in the wrong place.
Going to my issue, is basically that I have already the Job Queue defined with the correct codeunit to be processed in all companies, but it requires to my user to log in to each every company to automatically run the Job Queue, not doable. I have 120 companies! to run :-)!
Many thanks for your guidance!
Kind regards
DMA
I killed the NAS completely and use SQL Server Agent that runs PowerShell that calls a NAV webservice. Works as a charm!
Negative is that you need to set up jobs in SQL Server Agent. Creating new one-off jobs in Jobqueue doesn't work. But I am quite sure it is possible to implement that too. Never needed it, so I didn't look into it yet.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
This function will execute in the company you need.
Problem with batch jobs is that they can take a long time to complete.
So your webservice call will return with an timeout error.
Possible solution:
Using a few webservice functions, all within the company needed. The url contains the companyname where you want it to run, so loop through your companies and do the following sequence for each company.
So it is actually same idea as kriki is using, but then from within NAV using one job queue NAS