a Job queue run but got old data which updated earlier
robintptsai
Member Posts: 9
Any suggestion or guidance will be welcome for my weird question, thanks in advance.
There is a NAS service to run NAV job queues (by service account: domain\navservice1) on a NAV5.0 SP1 environment. The job runs well always.
Most of job queue entries created by domain\navservice1(User ID = domain\navservice1), except one job (Codeunit 80008, User Id = domain\navservice2)
The weird thing is: a user changed GL period from [7/1~7/31] to [8/1~8/31] in the morning already on 8/1, a job queue (to post sales orders, Codeunit 80008, run at 21:30 daily) run at night (21:30, 8/1) still got old GL period (7/1~7/31) and cause posting failed (posting period not allow)...
Is [Job Queue].[User ID] matters?
I've also checked the code and I think the local variable (LocalGLSetup) will be refreshed each time, however, the logs shows that LocalGLSetup variable got old value instead...
Keep checking, any guidance will be welcome, thanks again.
Here is my code (C80008):
OnRun(VAR Rec : Record "Job Queue Entry")
f_PostSOMain();
f_PostSOMain()
SRSetup.GET;
Msg := 'C80008 SO Auto Posting BEGIN ' + FORMAT(CURRENTDATETIME);
Log.f_Info('AUTO POST', 'C80008', Msg);
If NOT localGLSetup.GET Then ERROR('GL Setup not found');
Msg := 'GL Period: ' + FORMAT(localGLSetup."Allow Posting From") + '~' + FORMAT(localGLSetup."Allow Posting To");
Log.f_Info('AUTO POST', 'C80008', tMsg);
...
There is a NAS service to run NAV job queues (by service account: domain\navservice1) on a NAV5.0 SP1 environment. The job runs well always.
Most of job queue entries created by domain\navservice1(User ID = domain\navservice1), except one job (Codeunit 80008, User Id = domain\navservice2)
The weird thing is: a user changed GL period from [7/1~7/31] to [8/1~8/31] in the morning already on 8/1, a job queue (to post sales orders, Codeunit 80008, run at 21:30 daily) run at night (21:30, 8/1) still got old GL period (7/1~7/31) and cause posting failed (posting period not allow)...
Is [Job Queue].[User ID] matters?
I've also checked the code and I think the local variable (LocalGLSetup) will be refreshed each time, however, the logs shows that LocalGLSetup variable got old value instead...
Keep checking, any guidance will be welcome, thanks again.
Here is my code (C80008):
OnRun(VAR Rec : Record "Job Queue Entry")
f_PostSOMain();
f_PostSOMain()
SRSetup.GET;
Msg := 'C80008 SO Auto Posting BEGIN ' + FORMAT(CURRENTDATETIME);
Log.f_Info('AUTO POST', 'C80008', Msg);
If NOT localGLSetup.GET Then ERROR('GL Setup not found');
Msg := 'GL Period: ' + FORMAT(localGLSetup."Allow Posting From") + '~' + FORMAT(localGLSetup."Allow Posting To");
Log.f_Info('AUTO POST', 'C80008', tMsg);
...
0
Comments
-
Try adding a SELECTLATESTVERSION at the start of the code this should clear he client cache and get the most recent data.0
-
Thanks for suggestion.
I think SELECTLATESTVERSION is good way but it requires extra db permission which is not allowed under current IT policy, I will try to prove this solution did working and convince decision makers to adopt my proposal.
Many thanks.0 -
Are you sure it requires extra db permissions? I haven't read anything on this before or had any issues when using it. I have also checked the help file and MSDN and neither mentions that extra db permissions are required.0
-
Oh, it seems I had wrong concept on SELECTLATESTVERSION, let me try to figure it out.
Many thanks for such good comments.0
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions