Hi,
I've been trying to write some Java Script to show/hide a tab within the opportunity form using information online and reviewing other posts within the forum. On our form is a tick box field called 'TV' (wi_tv). When the field is ticked I would like the form to display a subgrid tab called 'TV Revenue' and when unticked the tab should not be visible. I've removed the 'Visible by default' tick from the TV Revenue tab and tried applying the below script, however when the form loads I get an error saying 'Object doesn't support property of method 'getvalue''.
function HideTVRevenueTabOnLoad() {
if(Xrm.Page.getAttribute("wi_tv").getvalue() ==1)
{
Xrm.Page.ui.tabs.get("TV Revenue").setVisible(true);
}
else {
Xrm.Page.ui.tabs.get("TV Revenue").setVisible(false);
}
}
I'm a complete novice with Java Script so no doubt I've made a rookie mistake somewhere in the script but having made several tweaks and changes to it I'm unsure where I'm going wrong. Any advice would be greatly appreciated.
*This post is locked for comments
I have the same question (0)