I have a tab (SalesUpdate) that i want to hide/show when there is a lookup field (new_change) value present but hide the tab (SalesUpdate) when it's blank. I kept running into errors with that so decided to set an option set field (new_type) via business rule based on if that lookup field (new_change) contains data. I ended up with the following code and this still doesn't work. I'm getting a is not defined at eval error.
function showHideTabs(){
var type = Xrm.Page.getAttribute("new_type").getValue();
if (type == 172960001){
Xrm.Page.ui.tabs.get("SalesUpdate").setVisible(true);
}
else {
Xrm.Page.ui.tabs.get("SalesUpdate").setVisible(false);
}
}
Is there someone that can help with a simple solution that won't error? If looking at the lookup field to be null or contains data is easiest please use that but if the options set is easiest please use that. I'm not hooked into one solution. Thanks in advance.
*This post is locked for comments