I am having an issue trying to hide and show a tab based on another fields value.
I have a field called, "Record Type" and this field is an option set. When this field is equals "Medicare" I want the tab to appear and when it doesn't I want it to hide. I currently have the checkbox "default visiable" on this tab unchecked.
function RecordTypeOnChange()
{
var RecordType = Xrm.Page.getAttribute("nhs_recordtype").getSelectedOption();
if (RecordType == "Medicare")
{
Xrm.Page.ui.tabs.get("tab_grievances").setVisible(true);
}
else if (RecordType != "Medicare")
{
Xrm.Page.ui.tabs.get("tab_grievances").setVisible(false);
}
}
Any help is greatly appreciated, thank you.