How to Programmatically Switch the Business Process Flow in Dynamics 365

Adam Murchison, 31 May 2018

You can update a records business process flow in many ways. I will show you how to update the BPF of a record in C# and in JavaScript .

Firstly, you will want to get the Id of the process you would like the record to be updated to. The id of the process I would like to use is: 28160C53-A54C-45AC-89FB-1C0673352D2B. This id can be retrieved through the Process Designer URL as shown below.

image

Through C#

Note: This logic will update the BPF for all leads.

image

Before:

image

After:

image

Through JavaScript

image

When I next opened the record, the below alert popped open and the BPF had been successfully updated! This is due to applying the above JavaScript on load of the form but you can apply this JavaScript other ways e.g. button click.

image