web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Business process flow stages hide/show based on the multiselect option from the form

(1) ShareShare
ReportReport
Posted on by 7
Hi Experts,
 
Can any one help me out this, while I am creating a business process flow in opportunity form, I want to show/ hide the multiple stages based on the multi selected option from the opportunity form use case below.
 
Type 1- Stage 1, Stage 2
Type 2- Stage 3, Stage 4
Type 3- Stage 5, Stage 6
Type 4- Stage 7, Stage 8
 
When new opportunity is created, no stage to be displayed.
On save, if type 1, type 2 is selected then Stage 1, Stage 2, Stage 3 and Stage 4 will be displayed. Steps under stages will remain same. No need to show/hide
 
Thanks in advance
I have the same question (0)
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    You can design BPF and JavaScript to fulfill the requirements.
     
    Since multi-select choices cannot be used for BPF, only single-select options can be used.
    stage1 cannot be hidden.
    Displays all stages when the /type/ field is empty.
    When the value of the /type/ field is type1, it displays stage2, stage3, and stage4.
    When the value of the /type/ field is type2, stage7, stage8 are displayed.
     
    Add Form OnLoad event.
    I added a custom Yes/No field /Whether to shou BPF/ to control the entire BPF display.
    When a new record is created, the value of this field defaults to No. Therefore, the BPF is not displayed by default.
    function onload(executionContext) {
        var formContext = executionContext.getFormContext();
       
        //Gets the value of the Whether to show BPF field.
        var showBPF = formContext.getAttribute("crc2c_whethertoshowbpf").getValue();
     
        //When the value of the Whether to show BPF field is No, the BPF is not displayed.
        if(showBPF === false){
            formContext.ui.process.setVisible(false);
        }
    }
     
    Add an On Change event to the /type/ field to display the BPF when this field changes.
    function onchange(executionContext) {
        var formContext = executionContext.getFormContext();
                formContext.ui.process.setVisible(true);
    }
     
    The final result is shown below.
     
     
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 118 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 46 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 41

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans