0

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?

Faran Saleem
  • 404
  • 1
  • 7
  • 31

2 Answers2

0

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”)}
AnkUser
  • 5,421
  • 2
  • 9
  • 25
0

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.

  • Hi @Arun. Yes you are right about its purpose. But my requirement is as such that I want to hide the collapsable section completely. I am using Classic UI and I have done some research and found that there is a expand event associated to the BPF and if I remove it, then it works for me as i want it. But the issue is using Jquery or JS I am unable to remove that expand event. Can you please help? – Faran Saleem Feb 21 '20 at 06:25
  • @FaranSaleem I believe tats going to be unsupported – Arun Vinoth-Precog Tech - MVP Feb 21 '20 at 12:16
  • Yes Unsupported way is fine – Faran Saleem Feb 21 '20 at 12:31