We will learn & understand to automatically expand / collapse a BPF in Dynamics 365. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in field of Dynamics 365.
Why do we need to dynamically collapse and expand a BPF in Dynamics 365?
Business process flows provide a guide for people to get work done. They provide a streamlined user experience that leads people through the processes their organization has defined for interactions that need to be advanced to a conclusion of some kind. This user experience can be tailored so that people with different security roles can have an experience that best suits the work they do.
By default, Microsoft displays the BPF stages in the collapsed view as shown below.
But there can be business scenarios where the users need to automatically change the view of a BPF according to their criteria. We can dynamically change the view (Collapsed, Expanded, Floating) of a BPF using the below given solution.
Using setDisplayState client API for dynamically changing the BPF display states –
We will use the setDisplayState client API for automatically updating the BPF states as given below.
formContext.ui.process.setDisplayState(state);Sets the display state of the business process control.
This API supports three stages namely “Expanded”, “Collapsed” and “Floating”.
Note: – The floating state is not supported in the Web Client.
Validate the changes in Dynamics 365 –
Thus, learned to automatically expand & collapse a business process flow in Dynamics 365.