Hi QuietClounds
You can use below code to hide and show tabs.
In this code, I'm trying to hide the Goals tab in Part item type when classification = Assembly else show Goals tab.
Input : Tab Label
Event : Form OnPopulated in Part Form
//debugger;
var tabname = "Goals"; //label of the tab
var showTab = true;
var classification = aras.getItemProperty(parent.item, "classification"); //Property based on hide and show tab should toggle
if(classification == "Assembly")
{
showTab = false;
}
hideTabs = function () {
if (!isTabloaded()) {
setTimeout(hideTabs, 200);
return;
}
var tabbar = parent.relationships.relTabbar;
var tabID = tabbar.GetTabId(tabname);
tabbar.SetTabVisible(tabID, showTab);
};
var isTabloaded = function () {
if (parent.relationships === undefined)
return false;
var isloaded = Boolean(!parent.relationships || !parent.relationships.relTabbarReady || parent.relationships.relTabbar.GetTabOrder("|") !== "");
return isloaded;
};
setTimeout(hideTabs, 200);