Editor’s note: The following post was written by Dynamic CRM MVP Gus Gonzalez
Scheduling Recurring Workflows in Microsoft Dynamics CRM 2011 Online and On-Premise
If you have read some of my previous posts you will notice that I am a big fan of utilizing out of the box functionality within Microsoft Dynamics CRM before looking at custom or third party solutions. For example, I previously blogged about utilizing the Unique ID generation capabilities of Microsoft Dynamics CRM with any entity instead of just the few out of the box entities for which this functionality was intended.
Microsoft Dynamics CRM MVP Matt Wittemann (@MattNC) came up with a solution to schedule recurring workflows within Microsoft Dynamics CRM without implementing any custom or third party solution. I knew I needed to share this with the entire community.
First, let’s ask: Why would you need recurring workflows?
There are many cases when you find yourself thinking: “I need ‘this’ to happen every X days” and you don’t know how to solve the problem. For example: You need to email a summary of resolved cases every month to a group of people within the organization. Or maybe send some of your contacts a monthly or quarterly email containing the link to your latest product catalog. How about a countdown of ‘days until launch’ on a custom Project entity? There is always something.
This solution requires you to create a custom entity, a couple of workflows and a recurring bulk deletion job. Five steps, that’s it.
1. Customize the ‘target entity’ if necessary, for example: if you want to countdown the days until a project must be completed, you could add a field to a “project entity” named “Days until completion” to be set when the project is created and that will be edited daily by the recurrent workflow. In this case, the custom “Project” entity is the ‘target entity’.
2. Create a custom entity; in this case I named my entity: “Workflow Assistant”. This entity will contain the name field, owner, an optionset (a.k.a. drop-down menu) field and a lookup to the “target entity”. The Target Entity is any entity that drives the process.
3. Create a workflow triggered by the Target Entity (I.E. A new project has been created). This workflow will create a ‘Workflow Assistant’ record to be deleted by the recurring bulk deletion job you will create on step number 5.
4. Create a workflow triggered by the deletion of the Workflow Assistant record, this workflow will perform the recurring task and create a new Workflow Assistant record to be deleted on the next cycle thus making it recurrent.
5. Create a Bulk Deletion job set to delete the Workflow Assistant records created by the two workflows from step 3 and 4 and configure the frequency (I.E. Every 1 day).
Here is a diagram describing the process detailed above:
Unfortunately, there were a lot of details involved on the configuration of this functionality so I have decided not to include all the screenshots and make this post too long and cumbersome, if you need more details please watch the video below; I have also included two additional examples to illustrate the capabilities of this simple solution; on the first example I will show you how to configure a recurring workflow to count the days a Lead has been neglected (I.E. Not contacted), on the second example I will show you how to configure a recurring workflow to send a weekly sales pipeline report to selected users:
About the author
Gus Gonzalez is a Microsoft Dynamics CRM MVP, Solution Architect and SMB Team Lead at Zero2Ten, Inc. He has over 10 years of consulting experience in the IT Industry, designing and implementing Microsoft Solutions ranging from enterprise to small environments. Worked as a full time Microsoft Certified Trainer from 2005 to 2009 teaching Microsoft Official Curriculum classes regarding Microsoft Windows, Exchange, ISA and SMS Servers along with Citrix, Cisco, EC-Council and CompTIA official curriculum. A Microsoft Dynamics CRM Community Guest Columnist passionate about User Adoption, he often talks about how Brazilian Jiu-Jitsu can be used to Increase User Adoption, a sport he has practiced since January 2010. Follow Gus on twitter @GusGonzalez2
About MVP Monday
The MVP Monday Series is created by Melissa Travers. In this series we work to provide readers with a guest post from an MVP every Monday. Melissa is a Community Program Manager, formerly known as MVP Lead, for Messaging and Collaboration (Exchange, Lync, Office 365 and SharePoint) and Microsoft Dynamics in the US. She began her career at Microsoft as an Exchange Support Engineer and has been working with the technical community in some capacity for almost a decade. In her spare time she enjoys going to the gym, shopping for handbags, watching period and fantasy dramas, and spending time with her children and miniature Dachshund. Melissa lives in North Carolina and works out of the Microsoft Charlotte office.