Job Queue with Task Scheduler and User ID

Hello,

I am facing problems in NAV 2018 with the Task Scheduler that runs Job Queues.

When a new NAV session is opened, all Job Queues are rescheduled by the codeunit Job Queue User Handler (function RescheduleJobQueueEntriesOnCompanyOpen).

My troubles come from the fact that these tasks will be executed on behalf of the current User ID.
So, a Job Queue will always run with the permission of the last logged in user instead of the User ID on the Job Queue Entry.

Have you already faced this problem? Is there a workaround?

Thank you in advance for your help.

Best Answer

Answers

  • JuhlJuhl Posts: 659Member
    I have done the same
    Follow me on my blog juhl.blog
  • nicolassaleronnicolassaleron Posts: 11Member
    Thank you, I will implement the trick :)
  • zeonzeon Posts: 130Member
    I still have a problem with this in NAV 2018 CU6. Could be nice to see some of tyhe actual code changes you guys have made.

    The extremely annoying thing is that when a new NAV session is opened, all Job Queues are rescheduled by the codeunit Job Queue User Handler (function RescheduleJobQueueEntriesOnCompanyOpen).

    Even though I have tried to modify the code in COD453 the scheduled task is still created in the user name for the user who logs on to the company next time.

    So, could be nice to get a hint about the code change you've made.
  • DoomhammerDoomhammer Posts: 207Member
    Hi, I am struggling with Task Scheduler.
    At our customer with NAV 2017 CU 18, we had C/AL code, which changed user ID after Scheduled Task has been created.
    Now we merged CU 29 and our code, which changed user ID stopped working. Modification of system Table Scheduled Task has now some internal validation, which prevents to changing user ID:
    "The task cannot be run because the user account that is assigned to run the task has been altered. The task has been canceled."
    Customer does not want to run scheduled tasks under ID of user, who enabled scheduled task, they want to run tasks under another user ID.

    Please, can anyone help me? Thanks!
    Martin Bokůvka, AxiomProvis
  • DoomhammerDoomhammer Posts: 207Member
    Bump, anyone knows? Please :)
    Martin Bokůvka, AxiomProvis
Sign In or Register to comment.