Keep Business Process Display State as collapsed

603 Views Asked by At

I am trying to keep the business process flow display state as collapsed.

I am currently making it collapsed at addOnStageChange

Xrm.Page.ui.process.setDisplayState('collapsed');

It works fine on Stage Change for me. But if I click on the same stage twice which means stage is not changing then the BPF gets expanded. I am assuming if it is the default behavior.

How can I prevent it from expanding permanently?

2

There are 2 best solutions below

6
AnkUser On

If you are using Unified Interface it will be collapsed by defualt.

But if you are using legacy web client.

Add onload event on your From (for ex.Opportunity entity) and add below lines of code.

function collapseOpporBusinessProcess(){setTimeout(collapseOpporBusinessProcessDelay,300)}

function collapseOpporBusinessProcessDelay(){Xrm.Page.ui.process!=null&&Xrm.Page.ui.process.setDisplayState(“collapsed”)}
3
Arun Vinoth-Precog Tech - MVP On

BPF cannot be collapsed always in classic UI, but possible in UCI like popout behavior or flyout without expanding. It needs some unsupported DOM manipulation in classic UI to nullify the click event of stage chevron or simply user training not to click it at all. Or better create a similar UI using webresource if you want.

It fails the original purpose, and re-purposing the BPF raise these kind of questions. If you have built the necessary business logic already in some other means - then custom UI is better choice rather than bending the BPF.

BPF is for guided process advancement, we can add attributes/entities as steps to move forward and enforce the field value requirements for reaching next level. I know some clients use them as tabs, some use them as just chevron tracker, so they don't want to waste the real estate under the BPF as they don't need any fields under the stages.