locked
Old Workflows Stuck in Waiting RRS feed

  • Question

  • Hi all,

    We have CRM 4.0 on server 2008.

    Basically a user created a bunch of workflows that are assigned to contracts, which fire of email alerts at x weeks before the contract end date. This user left and the workflows have been reassigned to a new user and updated with some changes to the outbound email message. The problem is all existing contracts use the old workflows and they are all seemingly stuck in waiting state, and they would not send the alert to the correct users due to the outdated email.

    My question is how can I update or replace this workflow on all existing contracts?

    Tuesday, October 5, 2010 9:54 PM

Answers

  • Identify the exiting contracts via advanced find.

    Select All

    Apply new workflow.

    Remove old workflow.


    Jeff Loucks | Available Technology | 888-474-2237 | http://msmvps.com/blogs/jeffloucks
    Wednesday, October 6, 2010 12:58 AM
  • When performing an Advanced Find, you want to look for references to the "System Job" entity, which represents an asynchronous job being processed by the Asynch Processing service.  Workflows are templates for System Jobs.  When a Workflow runs, a new System Job instance is created and the rules of the Workflow copied to it.  This is why changing a Workflow does not change any of the currently outstanding execution instances.

    When looking for Contacts which have the "old" set of rules, you will want to examine "Related" System Job records for a few things: the type being "Workflow", the "Title" matching the name of the workflow, the status being in a "Waiting" state, and a "Created On" date that is before the date when the Workflow was last updated.  This should help you target the Contacts which require a new instance of the updated Workflow.

    As Jeff also states, it's a good idea to cancel the outstanding "old" jobs.  You can search for "System Jobs" using the criteria identified above to cancel them in bulk.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Wednesday, October 6, 2010 9:25 PM
    Moderator

All replies

  • Identify the exiting contracts via advanced find.

    Select All

    Apply new workflow.

    Remove old workflow.


    Jeff Loucks | Available Technology | 888-474-2237 | http://msmvps.com/blogs/jeffloucks
    Wednesday, October 6, 2010 12:58 AM
  • When performing an Advanced Find, you want to look for references to the "System Job" entity, which represents an asynchronous job being processed by the Asynch Processing service.  Workflows are templates for System Jobs.  When a Workflow runs, a new System Job instance is created and the rules of the Workflow copied to it.  This is why changing a Workflow does not change any of the currently outstanding execution instances.

    When looking for Contacts which have the "old" set of rules, you will want to examine "Related" System Job records for a few things: the type being "Workflow", the "Title" matching the name of the workflow, the status being in a "Waiting" state, and a "Created On" date that is before the date when the Workflow was last updated.  This should help you target the Contacts which require a new instance of the updated Workflow.

    As Jeff also states, it's a good idea to cancel the outstanding "old" jobs.  You can search for "System Jobs" using the criteria identified above to cancel them in bulk.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Wednesday, October 6, 2010 9:25 PM
    Moderator
  • Thanks guys that worked perfectly. 
    Wednesday, October 6, 2010 11:07 PM