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 :
Microsoft Dynamics CRM (Archived)

Get BPF Stage and show/hide the tab.

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

any ideas on how to achieve this, i have to achieve this when user open the record, move to next stage.

Thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    you can use the below code to achieve it.

    function checkBPF()

    {

    var activeStage = Xrm.Page.data.process.getActiveStage(); // get the current stage of bpf

    var stageId = activeStage.getId();  // stage id

    var stagename = activeStage.getName(); // stage name

    alert(stagename);

    // you can apply your if else logic to show hide the tab, you can use stageid or stagename, depending on your preferences.

    if( stagename == "Qualify") // i would recommend to use stage id

    {

    Xrm.Page.ui.tabs.get("Qualify").setVisible(true); //set your tabname here.

    Xrm.Page.ui.tabs.get("anothertab").setVisible(false);//set your other tabname here.

    }

    else if ( stagename == "otherstage")

    {

    Xrm.Page.ui.tabs.get("anothertab").setVisible(true);

    Xrm.Page.ui.tabs.get("anothertab").setVisible(false);

    }

    }

    function formonload()

    {

    Xrm.Page.data.process.addOnStageChange(checkBPF); // this will help you to trigger the function when user click move to next stage

    checkBPF();

    }

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    furthermore if you plan to migrate to dynamics 365, it is not recommend to directly read the stage id via below method

    var stageID = Xrm.Page.getAttribute(“stageid”).getValue();

    For more information , please refer to below article.

    https://blogs.msdn.microsoft.com/crm/2017/07/30/how-to-determine-which-business-process-flow-bpf-instance-is-shown-when-a-record-is-opened-2/

  • Community Member Profile Picture
    on at

    Hi Alex,

    Thanks for the help, it is working now.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans