Microsoft Dynamics CRM 2013 Service Pack 1 – Workflow Processes ‘Group OR’ Statement

Colin Maitland, 17 June 2014

In this blog I will briefly describe the use of the new Group OR option for conditional branches in Workflow Processes in Microsoft Dynamics CRM 2013 since Service Pack 1.

When using Advanced Find in Microsoft Dynamics CRM there has always been the ability to group individual conditions together using either Group AND or Group OR; For example Group OR may be used for the condition, Country = Australia OR Country = New Zealand.

Prior to Microsoft Dynamics CRM 2013 with Service Pack 1, however, there has been no ability to group the conditions defined in a Workflow Process together using Group OR. All conditions where always grouped using AND. Separate conditional branches needed to be add to the Workflow Process to accommodate each OR condition.

The following flowchart diagrams sample business logic for assigning and routing new Leads based on the Country recorded against the Lead:

  •  If the Country is Australia OR New Zealand the new Lead is assigned to the Australia/New Zealand Leads Team and is routed to the Australia/New Zealand Leads Queue.

  •  If the Country is not Australia OR New Zealand the new Lead is assigned to the Non Australia/New Zealand Leads Team and is routed to the Non Australia/New Zealand Leads Queue.

In this example the Leads entity has been Queue enabled. By default, the Leads entity is not Queue enabled.

In the Workflow Process, the Assign steps are implemented using Assign actions, and the Route to Queue steps are implemented using Create Record actions. The Create Record actions create a Queue Item record with the Queue field set to the desired Queue and the Queue Item field dynamically set to the Lead.

 

The following image shows the design used to implement this business logic in the Workflow Process prior to Microsoft Dynamics CRM 2013 with Service Pack 1. Three branches, highlighted in yellow, are required to implement the business logic; e.g.

If Lead:Address 1:Country equals [Australia] then:


Otherwise, if Lead:Address 1:Country equals [New Zealand] then:


Otherwise






When specifying the conditions there was no option to group the individual conditions together using an OR statement, as shown in the following two images:

 

The following image shows the design used to implement this business logic in the Workflow Process after Microsoft Dynamics CRM 2013 with Service Pack 1. In this case only two branches, highlighted in yellow, are required to implement the business logic; e.g.

If Lead:Address 1:Country equals [Australia] OR Lead:Address 1:Country equals [New Zealand] then:

Otherwise
 


 

When specifying the conditions there is now an option to group conditions together using either a Group AND or a Group OR statement, as shown in the following image where the two conditions are grouped together using OR.

In conclusion, the addition of the Group OR option for specifying conditions for Workflow Processes is a great enhancement to Microsoft Dynamics CRM. The creation of Workflow Processes is easier, and the number of branches and repeated business logic is less.