Answered by:
Can I kill a workflow instance?

Question
-
Hi all,
I faced one issue where an existing workflow setting is like:
- on assign, workflow will send an reminder email after 24 hours.
Now the problem is when the record being reassign, it will create another instance of workflow.
My question is is there any way i can kill the previous workflow instance on pre stage of assign message using plugin.
I see stopworkflowactivity message in SDK. am I on the right track?
regards,
Toong Yang
http://eastoceantechnical.blogspot.com/- Edited by Toong Yang Thursday, March 25, 2010 5:40 PM typo
Thursday, March 25, 2010 11:36 AM
Answers
-
well you can cancel the existing waiting workflow instance, see following thread for the same
http://ayazahmad.wordpress.com/2009/12/30/auto-complete-recursivewaiting-workflows-microsoft-crm-4/
http://www.jonheupel.com/?p=114
hope this helps
- Proposed as answer by Mayank Pujara Thursday, March 25, 2010 4:08 PM
- Marked as answer by Toong Yang Friday, April 9, 2010 3:16 AM
Thursday, March 25, 2010 2:15 PM
All replies
-
well you can cancel the existing waiting workflow instance, see following thread for the same
http://ayazahmad.wordpress.com/2009/12/30/auto-complete-recursivewaiting-workflows-microsoft-crm-4/
http://www.jonheupel.com/?p=114
hope this helps
- Proposed as answer by Mayank Pujara Thursday, March 25, 2010 4:08 PM
- Marked as answer by Toong Yang Friday, April 9, 2010 3:16 AM
Thursday, March 25, 2010 2:15 PM -
Hi Mayan,
Thanks for the useful links!
actually my workflow is link with opportunity, for each record, it is possible to have a workflow running, so far i read the post is by workflow name and entityname,
if like this all related records with workflow in opportunity will be stop. Am I right?, possible to by records id?
regards,
Toong Yang
http://eastoceantechnical.blogspot.com/Thursday, March 25, 2010 5:39 PM -
Yes, it possible to do put further filter in to code..
so if you want to retrive workflow for specific opportunity only then add one more condition filter down record based on specific opportunity..
so your fetch will get only specific record and then either cancel or stop them as per your requirment..
let me know if you need any assitance in building the FetchXML query for you..(i.e. give me specific requirments and then i can buid the code for you if you want)..
- Proposed as answer by KunuChopra Tuesday, June 29, 2010 11:57 AM
Thursday, March 25, 2010 5:57 PM