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
Alex Hi !
you 're the man, it is absolutely working fine as what i was expecting.
Thank You so so much, you saved my day !! God Bless you.
Thanks again.
and now i need to work on Close opportunity button which i posted on separate page.
Regards
Faisal
Hi
please remove the last sentence "Show/Hide Tab js"
hi
at the mean time , you can try to refresh the form few times , sometime because of cache
Hi
share your code and print screen the tab name for me.
Hi Alex,
I just followed as per your given instruction but getting error.
PFA
Kindly check please
Hi
Get your tab name via below method
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.
if( stagename == "Qualify")
{
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);
checkBPF();
}
Show/Hide Tab JS
https://msdn.microsoft.com/en-us/library/gg328067.aspx#BKMK_tabsetVisible
It is working now,
Please refer to Image 2 and 3, which is the actual requirement : Also have added the form to better understand on the TAB
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
Hi,
As promised yesterday, You can use the below java script.
Samples
When form onload
When move to next stage
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();
}
Hi ,
please do not use stageId anymore , it is going to deprecate soon.
For more information , please refer to below article.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156