Hi,
I have been trying to get our CRM to show/hide tabs on a form based on the sale type that it relates to. We have an orders page that contains all relevant info for a sale, currently all fields for all possible sale types are displayed on the form I.E. Gas, Electricity, Telecoms etc. Based on a look up field at the top of the form I want to show the relevant tabs for the sale type. So far I have managed to get the system to get the system to hide tabs if they are not relevant for a sale but this results in the unwanted tabs showing for a few seconds while the system works through the script, a smarter way to do this would be to hide the tabs by default and then get the system to show the tab that corresponds to the sale type. I thought this would be as simple as reversing the code but it does not seem to work, whatever I try, the Electricity tab still shows up for all sale types. Please see below code and advise of any issues you can find... Thanks.
function showhidetab() {
//Get producttype
var producttype = new Array();
var producttype = Xrm.Page.getAttribute("new_producttype").getValue();
//If product type equals electric then show electricity tab
if (producttype = 100000001) {
Xrm.Page.ui.tabs.get("Electricity Contract Information").setVisible(true);
}
else {
Xrm.Page.ui.tabs.get("Electricity Contract Information").setVisible(false);
}
}
*This post is locked for comments
I have the same question (0)