CRM 2013 brings a range of new capabilities in terms of managing processes. From the new Flow UI form which walks the user through the steps to complete the process through to form management via synchronous workflows and the new ‘business rules’ configuration.
While the form management can be reproduced in CRM 2011 with jscript, there is no equivalent of the Flow UI. The best we can do is generate tasks via workflow. I recently had to do this for a client so I thought I would go through the steps here.
A Simple Sales Process
Let us say our process is:
- Stage: Contact Prospect
- Stage: Negotiate Contract
- Stage: Opportunity Won
Here we move from one stage to another by completing the necessary actions until we finish and win the opportunity.
A much simpler workflow is one where it creates all the steps at once. In that case the workflow is simply a series of ‘Create’ steps. This one is a bit more complicated but the behaviour is also a lot more complex in that it creates the tasks one at a time, the next one appearing as the previous one is completed.
The workflow kicks off when the opportunity is created and stays alive while the opportunity remains open.
The first thing it does is create our first task, ‘Contact Prospect’. A good idea with these tasks, especially if you are planning to generate a lot of them, is to incorporate unique information into the subject so that when all the tasks are listed, you know which ones relate to which opportunity.
The trick is we then wait until the task is completed or cancelled. We do this with a Wait step. In my example, the action following the wait is blank. The code purists would nest the next step into here but workflows in CRM have a finite number of nesting levels so, in this case, I simply put the next Task creation below the Wait step. As the workflow will not move on until the wait condition is satisfied, the end result is the same.
There is one final trick in my Wait step in that I have used a ‘Parallel Wait Branch’, one of the lesser used workflow steps. This allows us to specify multiple conditions for the wait and if any of them become true, the workflow moves on.
In this case, either the Task is closed or the Opportunity is closed. If the Opportunity is closed, the previous Task is cancelled and the workflow is forced to stop, as it is no longer required.
Finally, once all the tasks are complete, we can, if we wish, add in a Change Status step to the workflow to automatically close out the Opportunity.
The net result is a series of tasks which appear one at a time and guide the user through the process to closing the Opportunity. If the Opportunity is closed out at any point during the process, open Tasks are closed for us and the workflow is stopped.
If, for whatever reason, you are not in a position to upgrade to the upcoming CRM 2013, this is one way you can create a series of steps for a user to walk through to complete a process. While slightly harder to manage than a Flow UI process, it is still codeless and configurable by a power user.