Using a recursive CRM 4.0 child workflow to simulate a ‘DO Loop’

One problem I’ve run across is that Microsoft CRM 4.0 workflows do not allow you to loop. So if you have any kind of recurring process, you have to be creative to make it work. A common issue that I have to deal with in sales processes, is the situation where a workflow is designed to validate the data in an entity repeatedly until the user gets it right.  In this particular example, we want to make sure that an opportunity cannot graduate to the next step in the sales process until all the required data has been entered and assigned tasks completed.


The first step of this child workflow is a complicated test to verify that all the data has been properly filled in and that several tasks have been completed. If the test is true, workflow then:

* updates a status flag in the opportunity to tell a parent workflow it can continue,

* sends a congratulatory e-mail to the sales rep and his manager for moving another opportunity to the next phase,

* then the child workflow ends.

If the test fails,the otherwise branch performs the following:

* create a new task telling the sales rep about the missing or invalid information,
* wait for completion of that task,
* check a couple of other things,
* and ultimately the workflow calls itself to start the process all over again.

In the meantime, the parent (calling) workflow is waiting for the status flag mentioned above to be set to Yes, before it will continue.



Steve Noe

About stephenvnoe

CRM & XRM solution architect and project lead. I provide CRM design, services, mentoring & support to all manner of front office solutions and CRM projects.
This entry was posted in CRM 4.0, Customization and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s