Job in Queue dont run automatticaly
catiamatos1991
Member Posts: 158
Hi everyone,
I'm new in the "job world" of navision. I'm using nav 2016 and we have a job in our system (table job queue entry) which run's a code unit every day of the week except saturday and sunday.

In the log table (job queue log entry) i can see that this job only run 4 times since it was created, and not every day...
I can' figure why is this happening..

I read some stuff about server and client must be in the same domain, which is my case.
The user who created the job (not the admin) must have permissions, I guess he has..
I can't find any error / info in the event viewer of this specific job..
Codeunit 50001 code
I'm new in the "job world" of navision. I'm using nav 2016 and we have a job in our system (table job queue entry) which run's a code unit every day of the week except saturday and sunday.

In the log table (job queue log entry) i can see that this job only run 4 times since it was created, and not every day...
I can' figure why is this happening..

I read some stuff about server and client must be in the same domain, which is my case.
The user who created the job (not the admin) must have permissions, I guess he has..
I can't find any error / info in the event viewer of this specific job..
Codeunit 50001 code
OnRun(VAR Rec : Record "Job Queue Entry")
// >> type
//inParams := 'BankRec=10;'; // for tests
inParams := "Parameter String"; // >> for production
type := GetParametersType(inParams);
// >> register in log
CreateLog(Rec, type, 'Starting', inParams, TRUE);
IF type = 'BankRec' THEN
BEGIN
GetParametersSimple(inParams, params);
IF EVALUATE(varAsInt,params[1]) THEN
BankAccReconciliation(Rec, varAsInt);
END;
BankAccReconciliation(inJobEntry : Record "Job Queue Entry";inMarginDays : Integer)
// DELETE OLD LOG ("in progress" & <= 7 days)
DeleteOldLog(7);
BARec.SETCURRENTKEY("Bank Account No.");
//BARec.SETCURRENTKEY("Bank Account No.", "Statement Date");
//BARec.SETRANGE("Statement Date", inStartDate, inEndDate);
Count := 0;
CountExec := 0;
LogMessage := '';
IF BARec.FIND('-') THEN
REPEAT
IF ((BARec."Bank Account No." <> xBARec."Bank Account No.") AND (xBARec."Bank Account No." <> '')) THEN
BEGIN
CreateLog(inJobEntry, 'BankRec', xBARec."Bank Account No.", LogMessage, FALSE); // >> register in log (last BAR)
LogMessage := '';
END;
LogMessage += BARec."Statement No." + '; ';
BARec.MatchSingle(inMarginDays);
Count := Count + 1;
xBARec := BARec;
UNTIL BARec.NEXT <= 0;
CreateLog(inJobEntry, 'BankRec', xBARec."Bank Account No.", LogMessage, FALSE); // >> register in log (last BAR)
CreateLog(inJobEntry, 'BankRec', 'Finished', 'Total: ' + FORMAT(Count), TRUE); // >> finish
LOCAL [TryFunction] CreateLog(inJobEntry : Record "Job Queue Entry";inType : Text;inMessage1 : Text;inMessage2 : Text;isFinish : Boolean)
Log.ID := inJobEntry.ID;
Log."User ID" := inJobEntry."User ID";
Log."Start Date/Time" := CURRENTDATETIME;
Log."End Date/Time" := CURRENTDATETIME;
Log."Object Type to Run" := inJobEntry."Object Type to Run";
Log."Object ID to Run" := inJobEntry."Object ID to Run";
IF isFinish THEN
Log.Status := Log.Status::Success
ELSE
Log.Status := Log.Status::"In Process";
Log.Description := inJobEntry.Description;
Log."Job Queue Code" := inJobEntry."Job Queue Category Code";
Log."Processed by User ID" := inJobEntry."User ID";
Log."Job Queue Category Code" := inJobEntry."Job Queue Category Code";
Log."Error Message" := inType;
Log."Error Message 2" := inMessage1;
Log."Error Message 3" := inMessage2;
Log.INSERT();
0
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I don't get why bank reconciliation has to use job outside standar, it should be a process itself and then the job queue should call it everyday (except saturday and sunday).
We've something similar taking data from banks and we didn't overwrited job queue.
0 -
@KTA8 can you elaborate pls?0
-
catiamatos1991 wrote: »@KTA8 can you elaborate pls?
My point is that queue management is something standard, I don't see why you need to overwrite that functionality.
The codeunit should do the process and you can use call it in the standard way.0 -
I'm trying to find a way to automatically run the "bank account recompilation" in specific days, without the "job" because it is not working and i'm not understand the way you're saying how can i solve this...0
-
In Job Queue Entries if you create a new entry, put report 1001 for example every day at 20:00. This will run that report without doing any development.0
-
And how can I debug if it fails? It till log the error? I put to run my code unit 50001

Code Unit 50001Documentation() OnRun(VAR Rec : Record "Job Queue Entry") // >> type //inParams := 'BankRec=10;'; // for tests inParams := "Parameter String"; // >> for production type := GetParametersType(inParams); // >> register in log CreateLog(Rec, type, 'Starting', inParams, TRUE); IF type = 'BankRec' THEN BEGIN GetParametersSimple(inParams, params); IF EVALUATE(varAsInt,params[1]) THEN BankAccReconciliation(Rec, varAsInt); END;0 -
Standard makes a new entry each time it's used and if you press the error button, show you the error message if there's any problem.0
-
In table "Job Queue Log Entry" I don't have any new entry and it was supposed to run today at 5.300
-
catiamatos1991 wrote: »In table "Job Queue Log Entry" I don't have any new entry and it was supposed to run today at 5.30
What codeunit or report are you working with?0 -
Codeunit 500010
-
catiamatos1991 wrote: »Codeunit 50001
Use standard report to understand how it works.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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