I'm pulling my hair out trying to get this figured out. I'm trying to write what I believe is a very simple script, but I've literally been working on this for days and can't figure it out. Every code I write gives me an error. Every correction I make gives me an error. Error after error after error.
Can someone PLEASE help me? And use small words, because I don't understand what I'm doing.
I have a two option field and a tab. I'm trying to show the tab if a two option field is ticked Yes, else hide it. If it says No or is Blank, the tab should be hidden, if it says Yes it should be visible. I've written several different versions of this code based on info I've found online. This is the 18289357th version of code I've written trying to accomplish this.
What am I doing wrong?
function ShowTab(){
if(Xrm.Page.getAttribute("new_SRMPlan").getValue() == "1") {
Xrm.Page.ui.tabs.get("tab_5").setVisible(true);
}
else
Xrm.Page.ui.tabs.get("tab_5").setVisible(false);
}
}
*This post is locked for comments