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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Locked system jobs

(0) ShareShare
ReportReport
Posted on by 72

Hello all,

I got a set of system jobs that are locked in 'In Progress', they are not preventing any workflows from executing, but I wish to clear them anyways.  I am unable to cancel them via the UI and simply want them to go away as all of the related records have gone through their life cycles. 

I have tried restarting the Asynchronous Service already, did not work. 

The locked jobs are all related to 'System Events' meaning I have no idea the real origin of the job aside from a something happening on a source record. 

So far it appears that the only way to clear these locked records is to turn off the Asynchronous service and then using SQL update the state to canceled.  I realize that this change is unsupported by MS (Direct SQL Edit) but I don't see any alternatives.   Is this truly the only way to do this, there must be a better approach?

Related SQL (Our problem records are isolated to DEC 29th) 

use crm_mscrm

 

UPDATE AsyncOperationBase SET StateCode = 3 -- Completed 

,StatusCode = 32 -- Canceled 

 

WHERE (StatusCode = 20 -- In Progress 

OR StatusCode = 0 -- Waiting for Resources

OR StatusCode = 22 -- Cancelling

OR StatusCode = 21) -- Pausing

and Convert(date, StartedOn)  =  '12/29/2017'

*This post is locked for comments

I have the same question (0)
  • Rawish Kumar Profile Picture
    13,758 on at

    Hi Riley,

    You can bulk delete system jobs like any other entity records in CRM :

    Go to Settings-->Data Management-->Bulk Record Deletion. 2.) Click on new, it will present you a screen to configure, what records you want to delete. 3.) Select system jobs in looking for, mention your conditions like system jobs created last 30 days or something.

    mark my answer as verified if helpful

  • Riley-Hickman Profile Picture
    72 on at

    Great idea, but unfortunately you are only able to delete records that are in a completed state.  As these are stuck in 'In Progress' they are not completed and the bulk delete rejects them.

  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at

    then i would suggest you to create simple console app and run it against that environment - retrieve the system jobs - either you set the status to completed or delete them directly using organization service .

    you can find many blogs on how to create this console app.

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Riley,

    did you get around this issue? make sure to mark suggestions as verified to help others.

  • Riley-Hickman Profile Picture
    72 on at

    Sorry priorities changed was just able to get to this. Worked, thanks.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans