Hi,
I got this below code from the community and has some issue. Issue when lead is created and qualify to convert opportunity then the code does n't work. To work i need to refresh the opportunity page and the code works. But if i directly create opportunity then the code works.
_________________________________________________________________________________________________
//Registered the method in onload function formonload() { Xrm.Page.data.process.addOnStageSelected(checkBPF); Xrm.Page.data.process.addOnStageChange(checkBPF); } function checkBPF() { var activeStage = Xrm.Page.data.process.getActiveStage(); var stageId = activeStage.getId(); var stagename = activeStage.getName(); // you can apply your if else logic to show hide the tab, you can use stageid or stagename, depending on your preferences. if (stagename == "Discovery") { //// Its best practice to check condition with ID Xrm.Page.ui.tabs.get("Discovery").setVisible(true); //set your tabname here. Xrm.Page.ui.tabs.get("Proposal").setVisible(false);//set your other tabname here. Xrm.Page.ui.tabs.get("Advocacy").setVisible(false); Xrm.Page.ui.tabs.get("Close").setVisible(false); } else if (stagename == "Proposal") { Xrm.Page.ui.tabs.get("Proposal").setVisible(true); Xrm.Page.ui.tabs.get("Advocacy").setVisible(false); Xrm.Page.ui.tabs.get("Close").setVisible(false); } else if (stagename == "Advocacy") { Xrm.Page.ui.tabs.get("Advocacy").setVisible(true); Xrm.Page.ui.tabs.get("Close").setVisible(false); } else if (stagename == "Close") { Xrm.Page.ui.tabs.get("Close").setVisible(true); }
________________________________________________________________________________
Can you pl help where could be the issue ? }
*This post is locked for comments