Dynamics CRM 4 Recurring Tasks

Gayan Perera, 13 May 2010

Time for another crm goodie...

Here's a quick and dirty way of making tasks recur in dynamics crm using couple of attributes and a workflow!

Required Attributes

  • Name: Recur, Type: Bit
  • Name: StopRecurringOn, Type: DateTime

Workflow

How does it work?

First we set the 'Recur' flag to yes to indicate that this is a recurring task, then we have a simple workflow that watches the task and waits until it's status changes, eg: completed, canceled...etc, if it detects that this task is complete it does another check to see if the 'Stop Recurring' date is beyond the current date; which is the modified on date (not accurate since workflows are asynchronous, but this is good enough and works without having to open visual studio!). It then creates another task with the same information and sets the Recur flag to yes, sets the same Stop Recurring On date, once that task gets marked as completed another cycle of the workflow executes making it a recurring task until the Stop Recurring date is reached.

Enjoy!