Job Queue Entry keeps status <<In Process>>

sirknio
Member Posts: 7
Hi All,
When I schedule a job queue Entry, usually I set its status in Ready. The process executes the job according to the schedule, and when the NAS service executes the process, it uses the codeunit 448 to execute my process which I created.
Usually, the first step is set the Job Queue Entry status <<In Process>> and when any error appears with my codeunit, my process is stopped, and CU 448 insert a record in Job Queue Entry Log to inform the error, and the Job Queue Entry is set newly like "Ready" for next scheduling.
However, in some cases the record in Job Queue Entry Log is inserted but Job Queue Entry keeps status "In Process", and when the NAS Service try to execute again the process, the CU 448 filters only the Job Queue with status Ready, and my codeunit will not be to execute again.
Someone know why?
When I schedule a job queue Entry, usually I set its status in Ready. The process executes the job according to the schedule, and when the NAS service executes the process, it uses the codeunit 448 to execute my process which I created.
Usually, the first step is set the Job Queue Entry status <<In Process>> and when any error appears with my codeunit, my process is stopped, and CU 448 insert a record in Job Queue Entry Log to inform the error, and the Job Queue Entry is set newly like "Ready" for next scheduling.
However, in some cases the record in Job Queue Entry Log is inserted but Job Queue Entry keeps status "In Process", and when the NAS Service try to execute again the process, the CU 448 filters only the Job Queue with status Ready, and my codeunit will not be to execute again.
Someone know why?
0
Comments
-
I don't know the WHY except it happens to us generally the early stages of implementing a new piece of functionality when we get a hard error that we didn't expect or code for. Resetting the Job Status fixes the issue assuming the data is corrected or the condition that causes the error can be handled in code0
-
Maybe the process contain a confirm or some functions which require user interface?
In that case your job stay in process waiting for an input.* Daniele Rebussi * | * Rebu NAV Diary *0 -
geordie wrote:Maybe the process contain a confirm or some functions which require user interface?
In that case your job stay in process waiting for an input.
No geordie, I don't include any message or window to user interface. When I execute the process manually any functions which require user interface is shown.0 -
sirknio wrote:geordie wrote:Maybe the process contain a confirm or some functions which require user interface?
In that case your job stay in process waiting for an input.
No geordie, I don't include any message or window to user interface. When I execute the process manually any functions which require user interface is shown.
Also, when you run Job Queue on NAS it won't let you if there's any user interaction needed.
I know this behaviour only from scenarios since2002 describes. There must be any hard error that leads to a situation that doesn't allow Job Queue to finish properly. Assuming you run it on NAS, please have a look at the Windows Event Log to see if there's any error message in it."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I found the solution in this link from Microsoft, the problem is on standard code. You need to replace this existing code C448:
... WasSuccess := CODEUNIT.RUN(CODEUNIT::"Job Queue Start Codeunit",JobQueueEntry); IF WasSuccess THEN BEGIN IF JobQueueEntry."Recurring Job" THEN BEGIN JobQueueEntry."No. of Attempts to Run" := 0; JobQueueEntry.Status := JobQueueEntry.Status::Ready; IF NOT JobQueueEntry.MODIFY THEN JobQueueEntry.INSERT; END; END ELSE BEGIN IF JobQueueEntry."Maximum No. of Attempts to Run" > JobQueueEntry."No. of Attempts to Run" THEN BEGIN JobQueueEntry."No. of Attempts to Run" := JobQueueEntry."No. of Attempts to Run" + 1; JobQueueEntry.Status := JobQueueEntry.Status::Ready; IF NOT JobQueueEntry.INSERT THEN JobQueueEntry.MODIFY; END; END; ...
for this one:... WasSuccess := CODEUNIT.RUN(CODEUNIT::"Job Queue Start Codeunit",JobQueueEntry); IF WasSuccess THEN BEGIN IF JobQueueEntry."Recurring Job" THEN BEGIN JobQueueEntry."No. of Attempts to Run" := 0; JobQueueEntry.Status := JobQueueEntry.Status::Ready; IF NOT JobQueueEntry.MODIFY THEN JobQueueEntry.INSERT; END; END ELSE BEGIN IF JobQueueEntry."Maximum No. of Attempts to Run" > JobQueueEntry."No. of Attempts to Run" THEN BEGIN JobQueueEntry."No. of Attempts to Run" := JobQueueEntry."No. of Attempts to Run" + 1; JobQueueEntry.Status := JobQueueEntry.Status::Ready // Add the following lines. END ELSE JobQueueEntry.Status := JobQueueEntry.Status::Error; // End of the added lines. IF NOT JobQueueEntry.INSERT THEN JobQueueEntry.MODIFY; END; ...
Remember this is only for Dynamics NAV 2009 and 2009 SP1
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions