Friday, April 11, 2014

Dynamics CRM 2013 - Business Process Flows Switching

Business Process Flows which added in Dynamics 2013 are used to guide a user through the steps in a business process.  When a BPF, Business Process Flow, is enabled for an entity a process flow bar appears at the top of the form.


You can define a number of Business Process Flows for an entity and the order they appear in can be configured using the process flow order screen. A user’s security roles determines which Business Process Flows they can access. In my example I have custom entity called property and this has a different BPF when the property type is apartment than the other properties types.

The highest ranking BPF for the user will started automatically when the record is created.  The user must manually switch the process if the default flow is not the desired one.  There is no out of the out of the box functionality to switch the process conditionally based on the data entered.

Scott Durow has written a great blog entry here which explains how a real time workflow can be used to conditionally change the business process flow for an entity based on the data entered. This does work however there are difficulties refreshing the process flow bar at the top of the screen and whilst this blog suggests a number of ways to refresh the form after switching the process I have found that this does not always refresh the flow bar. 

An alternative is to notify the user to refresh the page by calling the setFormNotification method in the fields changed event as follows

function NotifyBPFChanged()
Xrm.Page.ui.setFormNotification('The business process flow has changed you need to refresh the page', 'INFO');


No comments:

Post a Comment