DCSIMG
How to create a repeating schedule workflow rule - Yaniv Arditi

How to create a repeating schedule workflow rule

I am often asked by my clients if Microsoft Dynamics CRM 4.0 can automatically schedule and perform a repeating task, such as sending an email notification to a Contact every year or adding a Note to a Contact record every day.

One trivial solution to this problem is developing a custom module that will be repeatedly launched by Windows Scheduled Tasks feature or Windows Service and perform the required task.

Another solution, one that does not require writing code, can be implemented using the Work Flow engine.
Let’s take, for example, a scenario in which we would like to automatically send ‘Happy Anniversary’ email greeting to our Contacts on their Anniversary day.

The following 8 steps describe how to set up the required work flow rule:

1. Create a new blank work flow rule for the Contact entity

image

2. Set the rule to be triggered by both the record Creation and Attribute change events. Set the scope to user, at least until you have tested the rule. 

image

3. Select the Anniversary attribute to trigger the record attribute change event

image

4. Add a Wait condition to wait until the Contact’s next Anniversary date

image

5. Add a ‘Send E-mail’ step, set the required email template (assuming you have one) and email details

image

6. Add an ‘Update Record’ step and set it to update the Contact’s anniversary date to next year Anniversary date

image

7. By the end, your work flow rule should look something like this:

image

8. Publish the work flow rule

9. Test the rule by creating a new pseudo Contact with a future date (e.g. tomorrow) as anniversary date and your email address. If all went well, you should be able to see a new rule instance waiting in the Contact’s workflows grid.
Past the target date, verify that the workflow rule has advanced and that you have received the greeting email. Also make sure the Contact’s Anniversary date has been updated to next year anniversary date.

Published Tuesday, February 10, 2009 3:19 PM by Yaniv Arditi

Comments

# re: How to create a repeating schedule workflow rule

Great example, it is just what i needed it.

Can the server's performance be affected if we have many workflows that works like this one? (I have to create 10 workflows like this one)

Friday, May 01, 2009 2:46 AM by Juliux

# re: How to create a repeating schedule workflow rule

Hi Juliux,

10 running instances shouldn't have a major impact on your server performance but it is always recommended to separate the database server from the application server.

As in version 4.0 the Asynchronous processing can be distributed to another machine, you can use this ability ever you discover a performance issue arises.

Monday, May 11, 2009 8:40 AM by Yaniv

# Good CRM Resources

1. Microsoft VPC Software – Allows running a virtual machine, required for item 2 in this list http:

Wednesday, June 17, 2009 11:11 PM by I LOVE C#

# re: How to create a repeating schedule workflow rule

What happens if someone creates the contact and then edits it?  Will there be two workflows running, waiting for the anniversary date?  Will two emails be sent?

Tuesday, November 23, 2010 11:56 AM by jim

# re: How to create a repeating schedule workflow rule

Hi,

What happens in case the account already exists? How would the workflow be initially triggered?

Monday, December 27, 2010 10:31 AM by Asher Kohn

# How to create a repeating schedule workflow rule « Hosk's Dynamic CRM 2011 Blog

Pingback from  How to create a repeating schedule workflow rule « Hosk's Dynamic CRM 2011 Blog

# re: How to create a repeating schedule workflow rule

thanks for sharing, Yaniv.

I am also thinking about the workflow scheduler.

How could you schedule a workflow which will be conducted in each month or each week. The only time-related attribute is data-time and the date is required, which means I can not schedule the workflow only by time.

Thanks for replying.

Sunday, March 27, 2011 9:14 PM by Lee

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: