1.800.323.3639 | Support | Training


CRM 2015 – Automatically Switching the Business Process Flow

| No Comments

Dynamics CRM 2015 has a simple enough way to switch the Business Process Flow in the user interface:

However, our client has a very complex case system with numerous business process flows and they didn’t need the extra three clicks (Switch Process, click the Process, Save) to select the process every time a new case came in or every time certain case attributes changed.

I found that in CRM 2015, many Business Process Flow actions can be automated as described inhttps://msdn.microsoft.com/en-us/library/dn817874. Changing the Process, moving to the next stage, moving to the previous stage, hiding or displaying the business process flow, etc.

I wrote a small common JavaScript function to set the Business Process Flow (for any entity). I used Xrm.Page.data.process.getActiveProcess to determine which Business Process Flow was active Xrm.Page.data.process.getEnabledProcesses to retrieve information about enabled processes that the user could choose for the case and Xrm.Page.data.process.setActiveProcess to switch to the appropriate Business Process Flow.

I added this common JavaScript file to the web resource Library of the Form Properties and then edited some fields Events, (Change Properties)

to call a different function OnChange to determine what the desired Business Process Flow should be and call the WF.Common.enableBusinessProcessFlow(newBPFname) to set it.

Voila, when the case type field changes on a case, the apporpirate Business Process Flow is set.

Thanks to Microsoft’s flexibility with Microsoft Dynamics CRM, Business Process Flow actions can be automated with CRM 2015. If you have a similar business scenario or would like our help in automating Business Process Flow actions, just contact us here.

Let’s Talk About CX