Hi all,
I need help in scheduling a job queue in NAV 2009.
I have created a coduenit-Test containing some business logic. The codeunit basically check a field value in one table, does some processing and updates the field value.
I have setup a job queue to execute this codeunit every 1 min.
I have also installed NAV Application Server and have used NASMSnapIn to started the service with below details.
Database Server Name = IM2
Database = NA-Demo Database NAV (6-0)
Company Name = Cronus Canada, Inc.
Start up Parameter = JOBQUEUE
Net Type = TCP/IP Sockets
Object Cache Size = 8000
Service Status = Started
The problem i face is that the codeunit is not getting scheduled for execution.
What am i missing?
Regards,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Answers
i have run codeunit Job Queue Dispacher mannually once then it works perfectly
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
"The Application Server for Microsoft Dynamics NAV IM2-SQL could not initialize properly.
The server will attempt to initialize every 30 seconds until this is successful. "
Does this mean my NAS is not started properly?
The link http://msdn.microsoft.com/en-us/library/dd355014.aspx in msdn says that a startup trigger in codeunit 1 with ID 99 is to be created.
I am not sure what does this means.
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
RIS Plus, LLC
MVP - Business Apps
I have also found that in order to start NAS i have to run codeunit 448 - Job Queue Dispatcher.
I had run this codeunit and it seems that the job queue is scheduled.
However if i open the Job Queue Process list it show one entry as below
Process is Running : Yes
Session ID : 56
User ID : hemant
Last Job Processed On : 08/27/09 05:36 PM
Object Type Running : 0
Object ID Running : 0
Object Name Running
From the above i understand that the codeunit Test is still not executed even though the job queue is scheduled.
Not sure why?
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
RIS Plus, LLC
MVP - Business Apps
I tried stopping and starting the service multiple times but the codeunit-Test is not scheduled for execution. Note that the startup parameter is set as "JOBQUEUE".
Once I run the "Job Queue Dispatcher" manually then only i see the job queue being executed.
It sounds strange to me.
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
:thumbsup: :thumbsup:
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I first installed NAS on my machine. This created two services IM2-CLASSIC and IM2-SQL, where IM2 is my machine name.
I then run NASMSnapIn.msc to open NAS MMC. I added one Application Server named "NAS" with following properties
--> Database Server Name = IM2
--> Database Name = NA-Demo Database NAV (6-0)-JIT
--> Company Name = Cronus Canada, Inc.
--> Start up Parameter = JOBQUEUE
--> Net Type = Default
--> Object Cache Size = 8000
--> Service Status = <blank>
I now run NAV 2009 Classic Client.
I created a table Test with two fields:- "No."(Integer) and CurrDateTime(DateTime)
I then created a codeunit 50000- Test Job Queue
I set the TableNo property of this codeunit to "Job Queue Entry" and Single Instance = Yes. This added a parameter Rec in the OnRun() trigger of the codeunit. I then wrote below code in this codeunit The purpose of the codeunit is to insert a record each time the job queue schedules it for execution so as to track how many times the codeunit is called.
I now setup a new job queue using the Job Queue Entry card and selected the above codeunit. The Earliest Start Date/Time is set as 5 mins after the current date and time. On Recurrence tab all fields are checked and "No. of Attempts to Run" is 0
I reset the status of the job queue to Ready
I now started the "NAS" service from the NAS MMC.
Nothing happened after 5 mins.
So i manually run the codeunit 448 "Job Queue Dispatcher".
Now it scheduled the job queue.
I opened the Test table and saw that one record was created. I waited for some time to see that some record will get inserted but what i noticed is that the Test table didn't contain multiple records.
I suspected that the codeunit "Test Job Queue" is not getting scheduled for next iteration.
To ensure this i opened the job queue entry card and what now i noticed is that the Earliest Start Date/Time got changed automatically. I am not sure how this happened.
I then set the status to on hold, manually correct the Earliest date/time to correspond to current date/time, reset the status back to ready.
I then opened the Test table. It shows two records.
I expected more records to be inserted. But no luck.
I once again went back to Job Queue Entry card and again i saw that the Earliest Start Date/Time has changed to next day.
From the above i understand that my codeunit is not getting scheduled repeatedly as the Earliest Start Date/Time is changed automatically.
I am not sure why this happens.
Can anyone assist me to resolve this issue?
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I meant "No. of Minutes between Run" and not "No of Attempts to Run".
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Setting value to 0 removes the error.
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
But after setting the Start Time and End time the error is not displayed.
I have another query w.r.t. display of messages when job queue is executing.
I wrote a simple message in a codeunit and schedule it for execution every 2 min interval and what i found is that after every 2min the message is displayed.
If i am not mistaken then NAS does not allow messages.
I am not sure why messages are displayed.
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
change it to error('my error");
so that you'll see it in NAV log
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
When i switched to Role Tailored Client i could not see the job queue getting executed.
What additional thing i have to do in RTC so as to allow the job queue to execute.
Note that when i first start the Classic Client i have to run Job Queue Dispatcher atleast once in order to schedule the job queue. This is a strange behaviour i am noticing so far.
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I tried creating a sample table with two fields and wrote a codeunit which inserts some data in this table. I setup job queue for this codeunit.
When i run Classic Client and open the sample table i can see records being inserted at scheduled time but when i run Role Tailored Client and open the same table in SQL Server i do not see any new records being inserted.
Is it something that i am missing?
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I am not able to troubleshoot this problem anymore.
I wonder if anyone has tried running jobqueue from RTC.
What i suggest for you to try and work out what i did, at your end and let me know if you are able to run job queue from RTC.
(1) Create a table say Test with two fields say "No." (Integer) and CurrDateTime(DateTime)
(2) Create a codeunit say Test Job Queue. Set TableNo property of this codeunit to Job Queue Entry so that OnRun() has a parameter Rec referring to this job queue entry record.
(3) Write below code in the OnRun() trigger of this codeunit:-
(4) Setup a job queue for this codeunit with Earliest Start Date/Time as today, set it as recurring Job for all working days, set Start Time = 9:30 AM , End Time = 6:00 PM and No. of Minutes Between Run = 1.
(5) Assuming that NAS service is started and running, open table Test in Classic Client at an interval of 1min.
The table Test will be empty.
Now run codeunit "Job Queue Dispatcher". You will see that the cursor will change to busy cursor at every 1min.
Once again open table Test. You will see record getting inserted at every 1 min.
(6) Close Classic Client. Open table Test in SQL Server.
(7) Run RTC and wait for few mins. Go back to SQL Server and refresh table Test.
You will see that after the time Classic Client was closed no new records are getting inserted in table Test although RTC is running.
Can you please do this simple exercise and let me know the outcome?
Awaiting for your reply
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Please check and make sure NAS is started and running. CHeck the eventlog, you should see a message that says.
NAS has started with paramater JOBQUEUE.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n