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);
...
0
Comments
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.
Many thanks for such good comments.