Hello,
When trying to hide or show a tab I keep getting a "TypeError: Cannot read property 'setVisible' of null". I understand why I'm getting this error because CRM can't find the tab name but I'm not sure how to correct it since I know the tab and tab name exist.
The tab is shown below:
I created the following sample code to try and do a simple test but I still can't get that to work.
function onSystemRequestFormLoad(executionContext)
{
hideTabTest(executionContext);
}
function hideTabTest(executionContext)
{
formContext = executionContext.getFormContext(); // get formContext
var tab_Job = formContext.ui.tabs.get("tab_jobstatuschange"); // get tab name
// test output
console.log("job tab = " + tab_Job);
// hide tab
tab_Job.setVisible(false);
}
Any thoughts as to what I'm doing wrong? According to the
MS Documentation it looks like I'm doing everything correct. Am I calling the arg wrong?
----EDIT----
Was able to figure out my issue. I renamed the tab on the form but I never did a full Publish All. So the tab was still showing the default value instead of what I called it. Apologies for my stupid mistake :/