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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

View StageID of Opportunity stages

(0) ShareShare
ReportReport
Posted on by 815

Hello,

How to view stage ID of opportunity stages.

Currently i am working on Opportunity --> Develop --> Proposal --> Close

Job is, on Opportunity we have 3 stages as shown above and down at the body page we have 3 Tab with the same stages name as above.

Now how to link Stage with its same tab ?

When Develop stage clicked then show move to Develop tab and next stage with next tab.

Help !

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: View StageID of Opportunity stages

    Hi,

    would be good if you can describe more.

    If you are referring to Business process flow Stages, you can follow the below methods to get the StageId

    SQL query (onPrem)

    select processstageid,stagename, processidname
    from filteredprocessstage
    order by processidname

    10311.1.jpg

    Javscript

    msdn.microsoft.com/.../dn817878.aspx

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: View StageID of Opportunity stages

    Hi Syed,

    You can use js to get the id of stages of opportunity.

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

    0486.1.txt.jpg

    Hope it helps :)

    Thanks,

  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: View StageID of Opportunity stages

    Hi Syed,

    you can easily do it using javascirpt - you have read the stage id and using which you will show and hide the tabs or sections on the form.

    www.fmtconsultants.com/business-process-flows-in-dynamics-crm-2013-hidingshowing-a-section-based-on-the-current-stage

    mark my suggestion as verified if helpful.

  • Syed_Faisal Profile Picture
    815 on at
    RE: View StageID of Opportunity stages

    Hi Wei Jie Fun,

    Thanks for the reply, let me describe the requirement.

    We have 4 Stages discovery, Proposal, Advocate, Close. on the form we have 4 tabs. Please refer to the image.

    Now when clicking on the discovery stage then it should show only discovery tab from the form, when moving to next tag Proposal then active both discovery and proposal form, then follow next stage.

    So, Requirement is initially all the form's Tab should not appear until we move stages step by step.

    6825.Opportunity.png

    hope you are clear.

  • Syed_Faisal Profile Picture
    815 on at
    RE: View StageID of Opportunity stages

    Hi Rawish,

    Thanks for the answer, i just followed the step as shown on the guide but i am getting error. not sure if the process is change on the version.

  • Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: View StageID of Opportunity stages

    Hi,

    Got it , i will reply you tomorrow with solution. Its very late in my side now.

    Thanks

  • Syed_Faisal Profile Picture
    815 on at
    RE: View StageID of Opportunity stages

    Thanks a lot !

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: View StageID of Opportunity stages

    Hi ,

    please do not use stageId anymore , it is going to deprecate soon.

    For more information , please refer to below article.

    blogs.msdn.microsoft.com/.../how-to-determine-which-business-process-flow-bpf-instance-is-shown-when-a-record-is-opened-2

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: View StageID of Opportunity stages

    Hi,

    As promised yesterday, You can use the below java script.

    Samples

    When form onload

    8284.6.png

    When move to next stage

    8284.6.png

    Javascript code

    - Register in onload event, and call the formonload function.

    function checkBPF()
    {
    var activeStage = Xrm.Page.data.process.getActiveStage();
    var stageId = activeStage.getId();
    var stagename = activeStage.getName();
    alert(stagename);

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

    function formonload()
    {
    Xrm.Page.data.process.addOnStageChange(checkBPF);
    checkBPF();
    }

  • Syed_Faisal Profile Picture
    815 on at
    RE: View StageID of Opportunity stages

    Hi Wei Jie,

    Thanks for the kind help!

    The script which you have send is working fine with any error. it is fulfill our requirement but as said not just stages.

    The one which you have send for Stages but i need also for the TAB. which are all on the forms.

    Please let me know if you got the requirement clearly.

    Like said :

    There are 4 stages on the opportunity and there are 4 Tab on the forms.

    Stages :

    Discovery

    Proposal

    Advocate

    Close

    Tab on the forms section.

    Discovery

    Proposal

    Advocate

    Close

    Now each stage should be link with each tab based on NAMES

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans