web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Restrict user from running Job Queue while another user is running it

(0) ShareShare
ReportReport
Posted on by 2,641

Hi,

We have created one job queue entry using object type to run Codeunit. If someone runs this Job Queue and at the same time another user try to run it then it should gives warning message.

Ultimately we want to restrict it to single user. Any suggestions.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Simple, don't give the execute permission to everybody of this object.

  • Jatin Patel Profile Picture
    2,641 on at

    Thanks but if i give permission to two users and first user is running it and second user try to run then i want to restrict him/her.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    When an job queue is running it will be in Process, so i am not sure what issue you are experiencing how multiple users are running the same job, could you please explain your issue in detail.

  • Jatin Patel Profile Picture
    2,641 on at

    Users can create multiple job queue with same codeunit. We can't restrict to single job queue. If the one is running then others can't.

  • Suggested answer
    Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    When Creating / Running Job Queue i.e. before changing the Status of the Job Queue to Ready you can write the code to check whether the same code unit is running by some other User and throw error.

    Regards

    Rajasekhar.Y

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    Jatin,

    I don't there is any standard setup to stop users creating multiple job queues with same codeunit/object or running it.

    You need to dothe customization on the job queue entry table on the Object ID To Run field validate check for duplicates and throw an error, so that you can restrict the users to have only one job queue for an object ID. This way you can restrict users creating multiple job queues for same codeunit and running it.

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    Hey Jatin,

    There is no setup or any other restriction available in the Default version of Microsoft Dynamics NAV. However if you really required to do this you can do a small modification to your code unit.

    Before executing your code, check if there any entry with your Object ID in the Job Queue Entry table and if there is then throw an error.

    However what is your intention of doing this? Even if several job queue entries been generated, Microsoft Dynamics NAV will run them one after the other and you won't have any problem.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    You can use any temporary table. When a user running the job queue then insert a line in that temporary table and when job queue will completed then empty the temporary table. Now when another user will try to run the job queue then let check is there any line in temporary table. If yes then error throws "job queue already running" else run the job queue.  

    Thanks & Regards

    Niraj Kumar

    niraj-msnav.blogspot.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans