[CRM 4] How to re-active failed asynchronous jobs

Because of different issues (e.g. missing some account in the PrivUserGroup) , you might find in your CRM system (this experience is based on Dynamics CRM 4, it might be applicable to CRM 2011) that some asynchronous jobs have failed and their current state and status is “Completed-Failed”.

How can you re-active these failed asynchronous jobs?

First option (supported): If they are on demand workflows, try to re-run them again

Second option (unsopported): Change the state and status of these jobs to “Ready-Waiting For Resources”. You have to do this from CRM DB using the next script:

UPDATE AsyncOperationBase

set Statecode = 0 , statuscode = 0

where asyncoperationid in

(

SELECT asyncoperationid

FROM AsyncOperationBase with (NOLOCK)

where StatusCode = 31

and CreatedOn >= ‘Start-datetime’ and CreatedOn <= ‘End-datetime’

)

These solution is also suitable for workflow expansion task

About Ramon Tebar

Software Engineer specialised on Microsoft Technologies with experience in large projects for different industrial sectors as developer, consultant and architect. I enjoy designing and developing software applications, it is my job and one of my hobbies. I’m interested in design patterns, new technologies and best practices. Making those part of the ALM process is a great challenge. During the last years, I have specialised in Microsoft Dynamics CRM (now Dynamics 365). I customise and extend the platform to provide tailored solutions and integrations based on service-oriented architectures and messages queuing. Motivated by community events and contributor in blogs, technical books, open source projects and forums, I have been awarded Microsoft Most Valuable Professional (MVP) on Dynamics 365 (CRM) since 2012.

Posted on January 25, 2012, in CRM, CRM 4. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: