Hi,
I am trying to disable/enable an Item's tab based on its classification. I created OnChange event for classification field on item's form and added the following code:
top.Tab = function ()
{
if (!parent.relationships)
{
setTimeout("top.Tab();", 100);
return;
}
var rel_tabs = "Cleaning Activities"; // Relationship Name
var tabsIds = top.aras.getRelationshipTypeId(rel_tabs);
if (parent.relationships.document.readyState != "complete" || !parent.relationships.currTabID)
{setTimeout("top.Tab();", 100); }
else
{
var recp_tabs = tabsIds;
var recp_type = parent.item.selectSingleNode("classification");
if (recp_type)
{
recp_type = recp_type.text;
alert(recp_type);
if(recp_type.indexOf("Cleaning") > -1)
{
parent.relationships.document.relTabbar.setTabEnabled(tabsIds, 1);
}
else
{
parent.relationships.document.relTabbar.setTabEnabled(tabsIds, 0);
}
}
}
};
setTimeout("top.Tab()", 200);
I found this code in a Form Event of ItemType's form.
This is not working, I am not facing any errors but it is not disabling the tab if I select other classification type. I am using Innovator 10.0
Any issues with my code? Please help me.