Job Queue for Unlimited Company
The Job Scheduler 4.0 has been replaced in in 5.0 by Job Queue. You can use Job Queue to schedule to run reports, Codeunits, as adjust cost. Job Queue uses NAS to run the job. As you might know NAS can only run for one company. Thus if you have multiple companies, you need one instance of NAS per Company. The following modification allows you to run Job Queue in unlimited companies. Using two license instances of NAS. You only need to install one NAS. The code run NAS itself as second instance connecting to different companies. The only difference Setup wise is the new field "Company Name" in Job Queue Entry Code, where you can select other Companies.
You could run with one instance of NAS and a Navision client, by running CU 448 directly from a client where NAS is installed. NAS service should be stopped. NAS uses windows authentication so make sure have windows authentication.
Feedback is welcome.
Enjoy.
http://www.mibuso.com/dlinfo.asp?FileID=924
Discuss this download here.
Comments
I just wanted to know whether this download can be used in Nav 4.0 Sp3.
Regards,
Guna
Why dont you try it yourself and let others know.
Najja
The big difference between you and ara3n (Rashed) is that Rashed shares his solution to the community =D> and that you only says that you have made a solution.
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 2009
The NAS cannot react on GUI-based messages - or is this possible in NAV 5.0 using GetLastError?
Otherwise a very interesting concept
You'll need 2 NAS client licenses.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
You need 5.0 executables. Because I'm using getlasterrortext function
as well as CurrentDirectory function.
You can take job queue object and move them to 4.0 db. They are self contained.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Variables such as WasSuccess are used by Navision CU Job Queue Dispacher.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Well there are other solution out there.
Plus there are several threads about running nas in multiple companies.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
There are only two variable that I used Hungarian notations. I don't like them either. I don't use them.
I was trying to make it easier to read.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Do you mean sessions (like granule 1200) or instances (granule 1415)?
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 2009
Navision already comes with 1 free NAS.
You need to only purchase 1 additional granuale 1415.
Also you need 3,810 Job Queue (ver 5.0 or later only) if you haven't had job scheduler.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
You are also using the new SQL-table 'Server' (new in 5.0 and only in SQL)
It can be used in Nav4 if you removes/rewrites the errorhandling and move the parameter read from the server-table to another existing table
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 2009
No I have not. I don't have vista. The way it looks like, most companies will be skipping vista and move to Windows 7 when it comes.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hi Ara3n,
I am importing the job queue objects into NAV4.0, SP2. I am taking the Job queue object as the customise object, meaning i change the object to 50000 series. I skip the coding for codeunit 1 as it involve the license agreement.
The objects are fine so far, except the function "GETLASTERRORTEXT" and "WindowShell.CurrentDirectory(ApplicationPath)".
Do you have any idea about replacing the above functions in NAV4 SP2?
Kindly advise.
Thank you.
Regards
Rachel
You need to do an exe upgrade and use the 5.0 executables.
If you can't use the 5.0 exe for some reason, you can change it to just write just a generic error. "Error during processing."
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hi ara3n,
thank you for the prompt reply. Yes, i can not upgrade to 5.0 exe. The client is not ready for 5.0 at the moment.
what about "WindowShell.CurrentDirectory(ApplicationPath)"? What is the directory that should refer to?
Thank you.
Regards
Rachel
The ApplicationPath is also a 5.0 variable. It returns where the current program is running from.
Basically where is NAS installed. So basically NAS runs it's own copy based on where it's running (installed) from
You can changed it to a setup, or harcod C:\program files\Microsoft Business Solution\Application Server\
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes, i understand about the difference between the exe and full upgrade. But we recently just upgrade the from NAV4 SP2 to NAV4 SP3. And i dont think i will propose to upgrade to NAV5 for this. My client involve LAN and WAN users...
OK, i will do a setup for the "current directory".
Thank you very much for your advise. I will try it out.
Regards
Rachel
I have 2 queries :
1) In the codeunit "Run NAS Accoss Company", there is a variable "strParamemter". Where is this parameter will be passed in?
2) How can i trigger the job queue for multiple company? is that mean in the main company book, i use the job scheduler to trigger the codeunit "Run NAS Accoss Company"?
Thank you.
Regards
Rachel
Add the following to CU 1
This is where it's called.
yes In main company you will setup Job Scheduler. You'll have a new field Company Name in there. And call My new codeunit which will start 2nd NAS for the other companies.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have added the code to CU1 as per your advice.
However, i am unable to trigger the job at the main company. Below is the setup at the MAIN company:
1) at "Job Queue Entry Card", i setup to run a report 50000 for company A and company B. The status for the entry is defaulted to "On Hold"
2) at "Job Scheduler Setup" (F6091), i setup the CU "Job Queue Start Codeunit".
When the time the job has been trigger, the system does not proceed to run the job. The message is as below : The job scheduler stopped due to an error. The program has moved the job to the next run date and time.
Is there anything that i setup wrong?
Thank you.
Regards
Rachel
I'm guessing you are moving job queue to 4.0 database?
I suggest to first do the test in a 5.0 exe so that you can see the error and learn how it works, then move it to 4.0.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes, you are right. I move the job queue to NAV4.
OK. will try your suggestion.
Thank you.
Regards
Rachel
I have tried the NAV 5 standard, the job queue work fine. Then i imported the objects for job queue for unlimited company.
The job got triggered and executed fine if WIHTOUT assigning the company name at the "Job Queue Entry Card".
Once assign the company name, the job (to run a report) got started by prompting a blank command prompt window with the current directory at the title bar.
The report suppose to update some information at the customer card, however, nothing has been updated.
Is there anything wrong / setup that i have missed out?
Kindly advise.
Thank you.
Regards
Rachel
Any advices on the problem that i posted on May 29?
We are running out of idea what to do next.
you advice is highly appreciated. thank you.
Regards
Rachel
Sorry I had not read your may 29 post. I will take a look at it this by next week.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thank you very much.
We are really running out of idea how to solve it.
Regards
Rachel
You saved me a heap of time.
Works like a charm.
I adapted to work with V4SP3 without having to use the Job Queue.
Question:
I see that the StartUpparameter is configured as follows:
JOBQUEUE2|'+COMPANYNAME+'|'+FORMAT(JobQueueEntry.ID);
My question:
I understand that I need to install a NAS. Do I also need to setup a NAS-client. And if I do, with what StartUpParameter should I set up this NAS-client.
Because the StartUpParameter created in this functionality is different every time.