Related sites:

Newsletter: Perspectives on Power Platform

Company: Niiranen Advisory Oy

Getting Your Head Around Dynamics CRM 2013 Processes – Part 2

In the first part of this series we looked at the two new process categories introduced in Dynamics CRM 2013: Business Process Flows and Actions. Now it’s time to dig deeper into new CRM 2013 functionality that will allow you to achieve process automation results in areas where custom code was previously required.

Business Rules: Processes In Disguise

You may have already heard about the new feature in CRM 2013 that promises to free us from writing Javascript to manipulate form fields, called Business Rules. If you’re looking to find them from under the Process Center, though, you’re in the wrong place. Business Rules are a property of the entity and you’ll see them alongside other such components like Charts and Views in the Solution explorer. From this we can already gather that it won’t be possible to move Business Rules across different CRM organizations as individual components like you can do with processes, instead they always travel with their parent entity in the solution files.

CRM_2013_Business_Rule

Business Rules have the nickname of Portable Business Logic (PBL), so there must be something else that makes them particularly easy to carry around then? The portability actually refers to the way in which the rules can be applied to all the different forms of the entity and also to how they will be carried over to the mobile client application (MoCA) on Windows 8 and iOS tablets. They are however form specific in the sense that you must define what the scope of the Business Rule is: either tied to a particular form of the entity or simply set to run on “all forms”.

What can you use Business Rules for from a process automation perspective? Similar to the Business Process Flow (BPF) process type, Business Rules can be used for guiding the data entry and update tasks by dynamically changing the UI presented to the user, based on the values of other fields on the form. Typically CRM entities end up having far more fields available than what a user is really expected to fill or even view in a particular stage of a business process. Whereas the Business Process Flow can only touch the Process Control shown on the top of the entity form, Business Rules can manipulate any field on the form, setting it either as visible/not visible, required/not required and disabled/enabled. They also have the ability of presenting field specific error messages if a user tries to deviate from the intended process.

Business Rules have a similar type of conditional statement setting as workflow processes do (if/then), but it is quite a lot more limited currently than the workflow editor options. For instance, you can only reference fields from the same entity you’re working on, so setting the requirement level of a contact form field based on the parent account record’s values won’t work. You are also limited to only specifying a single set of conditions that must all be true for the action to run. In order to build an “or” rule to cover multiple alternative conditions you’ll need to save your first Business Rule, then create a copy of it with Save As and have as many concurrent rules as there are options in your “or” statement.

Unlike the Business Process Flow processes that are only able to present fields from the entity, Business Rules can actually update the record as well. The “Set field value” action allows you to input either a static value, copy the value of another field (on the same record) or perform a simple +/-/* calculation with two fields. For an in-depth list of Business Rule capabilities and considerations, look no further than this excellent article by Jesper Osgaard on Understanding Portable Business Logic.

This first release of Business Rules for Dynamics CRM 2013 addresses many of the common scenarios where Javascript has previously been applied on entity forms to make them dynamically adapt to the business logic of an organization. However, there remain some frequently requested features that will still require form scripts to be developed, such as:

  • Create dependent optionset fields (filtering available values based on another field)
  • Set dynamic default values (“task deadline today+3 days”)
  • Show/hide form components other than fields (tabs, sections, subgrids, iFrames, Quick View Forms etc.)

Based on the fact that Business Process Flows are categorized as a process record in CRM 2o13 whereas Business Rules are “only” a component of an entity, should you spend more time designing the Business Process Flow and resort to Business Rules only when you need to tweak some details on the forms? I personally don’t think that the BPF Process Control is necessarily the only right way for implementing guided processes in CRM 2013. For a transactional record with a linear process consisting of several stages with clear boundaries (the sales opportunity scenario) it is surely a natural fit, but in many situations the flexibility provided by the field level configuration of Business Rules can prove to be a more practical approach. At least ask yourself these question before committing to a BPF based design: 1) does it offer some required functionality that Business Rules could not replicate, and 2) can the process data naturally fit into the stages that the Process Control will display?

Real-Time Workflows: Plug-ins For The Analysts

For the past 10 years the Dynamics CRM workflows have been tirelessly performed their tasks behind the scenes, driven by the time slots that the asynchronous service on the CRM server has kindly allocated for them. Originally designed for executing workloads that didn’t have a need to present the results immediately to the same end user who triggered the event, they’ve since been frequently leveraged also in process automation tasks that would have performed much more smoothly with a synchronous execution (also known as “poor man’s plug-ins”). The powerful process automation capabilities presented in the workflow editor would have often been enough to meet the business logic customization requirements, had it not been for that delay in the logic’s execution that demanded the same logic to be replicated in custom code instead.

In CRM 2013 workflows have now been promoted to a 1st class citizen status by adding one tiny switch: “Run this workflow in the background [yes/no]”.

CRM_2013_Real-Time_Workflow

Why is this option of running workflows synchronously so important then? Well, if you’re just using your workflow to send an email notification to someone, there’s precious little difference in whether the action takes place immediately or after one minute. However, if you are updating the current record that the user is currently viewing through the entity form, the fact that you can present the changes right away opens up a whole new world of opportunities for leveraging workflows to guide the business process.

Nowadays when the new CRM 2013 entity form design leans towards a dashboard style of summary views presenting a number of subgrids of child entities, activities or activity feed posts, the need for immediate feedback on the UI applies also to the creation of related records through workflows. If your business process relies on the assignment of tasks to users rather than the “mark completed” checkbox driven style introduced by the new Business Process Flows, the fact that the user will see the process automation in action as he updates the records in CRM will surely help to build confidence in the system’s ability to manage the business process and distribute information to all relevant parties, without the need for manual emails or phone calls to coordinate the work.

From a development perspective, Real-Time Workflows have a similar but likely far more significant impact on the division of labor between the business analyst and the .NET developer than the new CRM 2013 Action processes that we covered in part 1. Synchronous workflow processes can cover many of the common CRM customization scenarios that would have previously required developing a plug-in. While a custom plug-in will naturally still remain far more flexible in terms of its ability to query and manipulate data, the Real-Time Workflows will drive more and more custom code to be developed as Custom Workflow Activities rather than plug-ins.

This is because of the fact that if you can isolate your code into a component that the business analyst can call from a standard workflow process, the configurability of the business process automation functionality will be greatly enhanced as future adjustments to the process can be performed through the CRM UI without touching any code. The development of re-usable components that extend the default capabilities of workflows also lowers the barrier of applying the same custom logic into new processes as the needs of the customer organization evolve.

The less people it takes to solve a business problem through CRM and the shorter the lead time from identifying the problem to deploying the solution is, the more likely it is for the problem to get solved. This is the main reason why increasing the share of configuration tasks over development tasks is so critical for any business information system that needs to adapt to changing business processes and not just fulfill a static set of requirements. If you’ve worked with CRM systems beyond their initial implementation projects, you’ll surely know into which category these systems fall into.

The Growing Business Process Automation Toolkit

If we compare the old and the new world of process automation in Dynamics CRM, we can see that the tools available for no-code configuration of business process management functionality have grown considerably over the past few years:

  • CRM 4.0: workflows
  • CRM 2011: workflows, dialogs
  • CRM 2013: asynchronous workflows, real-time workflows, dialogs, business process flows, business rules, actions

What this means from a system administrator, customizer or business analyst perspective is that if you haven’t yet started to take advantage of the process automation capabilities of Dynamics CRM, you’re really missing out on a significant share of the platform’s potential value to your business. At the same time the growing number of options in CRM can make it seem like an increasingly difficult topic to approach. How do you know which one of the six tools to pick for building a solution to a business problem you’ve identified?

As discussed in part 1 of this article, Business Process Flows are essentially just a map of the process that you present to the end user, but they don’t perform any actions on the data on their own. Since the Action processes are currently only valid for scenarios that involve a developer resource, we can also leave those our when exploring the right tools of how to get started with CRM process automation. That leaves us with four tools to evaluate for their fit to get the job done. I’ve compiled some of the main characteristics of each of them into the following table to help you in the selection process:

CRM_2013_Process_Automation_small

You should pay attention to the following constraints of each tool when analyzing their fit for the task at hand:

  • Business Rules are the only way to perform actions right after the user updates a field. Workflows will not fire until the save event (which can be 30 seconds away in the new auto-save CRM 2013 organizations).
  • Workflows will run even when the records are created or updated through other means than the form (data import, integrated systems). Business Rules are only executed on the form.
  • Due to the aforementioned limitation, Business Rules also only ever apply to a single record at a time.
  • Workflows can reference data from related entities for read/update. Business Rules can only work with data available directly on the form.
  • The special capability of Business Rules includes manipulating the UI (hide/show fields, set requirement level, show alerts). Workflows only deal with the data.
  • Dialogs are a manually initiated subset of workflow functionality with a specific Wizard style UI. They also have one special skill: querying data from any entity, not just the directly related ones.

I hope that this article has managed to highlight the new features in Microsoft Dynamics CRM 2013 that can help you build solutions for guiding the user through a business process and automate the related tasks. There is a lot to explore in the latest CRM release in this area and I’m sure we’ll discover many creative ways for applying these new tools in practice as more and more customers move onto the CRM 2013 / Fall ’13 platform.

9 Comments

  1. Great post, and a good summary of the different use cases.

    In reality, customers also have 3rd party tools to choose from that can also move more customization tasks into the configuration realm.

    At Visionary software, we believe that anybody who finds value in the PBL Business Rules functionality will find 10X the value in using CRM Rules! See http://crm-rules.com for more.

    If you are going to Extreme next week, please check out my ISV session where I’ll compare CRM Rules 2013 to PBL.

  2. Hi,

    Wonderful post, thanks very much for sharing.

    I wonder if you can comment on any performance impact you know of if you compare some of the processes now available in CRM 2013? E.g. if you have requirements that must be met synchronously, is there any difference between performance of say a real-time workflow vs synchronous plugin?

    Thanks,
    Priscilla.

    • Priscilla, I don’t have any real life experience of performance differences between plug-ins and real-time workflows performing the same actions. The CRM 2013 SDK has the following to say on the topic:

      “Use plug-ins when you need the best performance possible from your custom business logic. Plug-ins can start quicker and therefore typically run faster that even a real-time workflow. However, the benefit in performance may be outweighed by the ease of use in creating and maintaining workflows where only a non-developer, for example a business analyst, is required to do the work.”

      As the creation and modification of synchronous workflows for simple updates is so easy through the UI, a sensible approach in my opinion would be to build the custom business logic through a workflow first and then validate that it meets all the user requirements. If performance is a critical factor, you could later implement it in a plug-in once the process is unlikely to change anymore.

  3. For anyone wondering about what’s the performance difference between Dynamics CRM 2013 real-time workflows and plugins, be sure to read this great blog post by Scott Durow, where he analyzes the performance impact: http://develop1.net/public/post/Real-Time-Workflow-or-Plugin.aspx

    I think Scott’s conclusions are well in line with my own view: when you are dealing with a work-in-progress process that’s design is being tweaked and you don’t yet expect a high number of transactions to occur, real-time workflows can reduce the maintenance cost of the system via the flexibility that the GUI offers. If you’ll have a CRM developer involved anyway and expect either the transaction volume or the process logic complexity to rise up in the future, you should plan for implementing the process automation as a plugin instead.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.