OR Statement Workflows in CRM 2013, Spring Wave Release – New functionality

One of the new features of CRM 2013 was the inclusion of Real-Time or Synchronous Workflows, this gave CRM customisers the ability to trigger a Workflow which would run instantly with out having to write Plugin automation/JavaScript. To put this into context – if a user updated a field on a record, this update would trigger a real time Workflow (defined in the activation criteria)  and could update a field on the form in real time without refreshing the page.

For further information about Real Time (Synchronous) Workflows, a blog written by Steven Foster can be found here:


Now, Microsoft has gone one step further and has  implemented one of the most requested features missing from Workflow in CRM with the Spring Wave release for Microsoft Dynamics CRM 2013.

I introduce you to the ‘OR’ statement.

The OR statement has finally been added as part of the conditional criteria for Workflows, just like it is included in the Advanced Find functionality which lets users build up their required lists and views of data based on conditional logic.

For example, a user has the requirement “Show me a list of Accounts which have the word ‘Hospital’ or ‘Clinic’  contained in the name (I have omitted Status in this example):


When building a Workflow, the customiser needs to define  four certain aspects:

  • When to start them?
  • Should they run as a background Workflow or a real-time Workflow?
  • What actions should they perform
  • What conditions should the actions perform?

(For further information about these aspects can be found in the Help section on technet http://technet.microsoft.com/en-us/library/dn531067.aspx)

I am now going to focus on the last aspect “What conditions should the actions perform?” by using an example and including the OR statement and where/how it can be used.


For each “Active” Account record in CRM, if the Name contains either ‘Hospital’ or ‘Clinic’ or ‘NHS’ then update the Parent Account lookup field to an Account called = ‘National Health Service’ (a fairly useless requirement but will serve the purpose for our example).

Previously in CRM, we would have to build up conditional logic with multiple conditional branch’s (‘Check Condition’s) and record updates. It would look something like this:


It can be seen there is no ‘OR’ statement and conditional branching was the only was to achieve this conditional logic:

  • IF the Account Name contains Hospital then Update the Account
  • Otherwise IF the Account Name contains Clinic then Update the Account
  • Otherwise IF the Account Name contains Hospital then Update the Account
  • Otherwise stop the Workflow

Either three separate update steps to the Account are required to perform the Parent Account update or a single child Workflow (performing the Account update step) will need to be triggered 3 times (one for each conditional branch).

Logically, the Workflow performs a check  on the first ‘Check Condition’; if the record matches the criteria the Workflow executes the update step, if no match is found the workflows proceeds to the next conditional ‘Check Condition’ and checks the criteria and so on. If no match is found in any of the branch ‘Check Condition’s, the Workflow is completed.

Performance wise, this takes the Workflow longer to run as it has to run against each ‘Check Condition’ in order, until a match is found; for Accounts with the Account Name containing ‘Clinic’, the Workflow performs 2 additional ‘Check Condition’s than for an Account with the Name containing Hospital.

The OR Statement.

Microsoft allows us to perform the 3 ‘Check Condition’s above in just 1  ‘Check Condition’ using the “Group OR” button.

This allows us to group checks together with either an “AND” or an “OR” statement.



Now we can build a Workflow that can perform all the conditional ‘OR’ checks in one ‘Check Condition’.



In theory, this should increase the performance of the Workflow as it only needs to perform 1 Check Condition and 1 Update step, although it will take slightly longer to perform the check condition. From a customiser point of view, this has saved time constructing these types of Workflows as it reduces the number of Conditional Branch’s and Check Conditions we need to input which we previously had to build.

If you have updated your CRM 2013 Organisation (either On Premise or On-line), you can now have fun transforming your existing Workflows which use the Conditional Branch logic to create ‘OR’ statements into actual ‘OR’ Statement Workflows!

Thank you for reading and I hope this blog helps!




Microsoft Dynamics CRM 2013 ERD Visio’s

Part of my job as a Microsoft Dynamics CRM Consultant involves writing Project documentation for each of my customers. One of the most requested items in the documentation is an Entity Relationship Diagram or ERD for short. 95% of my previous projects are not out-of-the-box (OOB) Microsoft Dynamics CRM (CRM), and to meet the customers requirements involves at least one or more additional custom entities in addition to the OOB entities such as Account, Contacts, Opportunities/Order etc.
When I am writing documentation and creating any ERD, I always have a base Visio template showing the OOB entities and the basic relationships between them and all I have to do is add my custom relationships and custom entities. Building this template up was painstaking at first just to get the relationships/entities correct, I deemed this task as invaluable as it saved myself time each time I that I have reused them.

Earlier today, I was eating my lunch and quickly checked on the CRM forums/Facebook/LinkedIn groups and happened to stumble across a link for the Entity Relationship Diagrams (ERD) for CRM 2011, I click on the link (http://www.microsoft.com/en-gb/download/details.aspx?id=2640) and low and behold I am on the official Microsoft website and Microsoft have provided us with an ERD. You can then download a zip file containing a seperate Visio file for each main area in CRM, such as Activities, Sales, Customer service etc. This gives a breakdown of each entity involved.

I was actually amazed at this, as I know how little documentation Microsoft had provided the CRM community in the past. So, I asked myself the question: “WHAT ABOUT CRM 2013???!”,
So I Googled ‘Microsoft Dynamics CRM 2013 Entity Relationship Diagram” and hit enter (sorry for you Bing fanatics out there) and again the link appeared:


And here is a screenshot of one of the Visios:


It is dated 17/04/2014, this means it will be out of date for the Spring Wave release update with the inclusion of the new SLA and Entitlement entities (plus any other key entities supplied with the Spring Wave release) and hopefully will be updated in the near future.

Regardless of this fact, I can now compare/include these Visio’s into my template giving the customer a list/overview of entities that are provided OOB for each area in CRM, these Visios will help save time with these areas of the documents I need to produce ERD’s for and allowing me to focus more of my time on the key details of the documentation I am producing, such as the functional and technical requirements.

I hope this blog helps some of my fellow peers in the CRM community!