Hello,
I have been using CRM for 4 years now and know how to create forms and workflows etc but never done JAVA before so this is me stabbing in the dark.
Within the entity I am using there is JAVA already used to hide a tab so assumed I could copy this for a new tab created and it would work...as you can guess it didn't.
This is the JAVA already in the entity with my bits in yellow
function Form_onload()
{
Xrm.Page.ui.tabs.get(2).setVisible(false);
Xrm.Page.ui.tabs.get(3).setVisible(false);
Xrm.Page.ui.tabs.get(5).setVisible(false);
Xrm.Page.ui.tabs.get(7).setVisible(false);
if(crmForm.all.optevia_appointmenttype.SelectedText =="High Risk Visit") {
Xrm.Page.ui.tabs.get(3).setVisible(true);}
else{
Xrm.Page.ui.tabs.get(3).setVisible(false);}
if(crmForm.all.optevia_appointmenttype.SelectedText =="Firesetter Visit") {
Xrm.Page.ui.tabs.get(2).setVisible(true);}
else{
Xrm.Page.ui.tabs.get(2).setVisible(false);}
if(crmForm.all.optevia_appointmenttype.SelectedText =="TFS - Audit") {
Xrm.Page.ui.tabs.get(7).setVisible(true);}
else{
Xrm.Page.ui.tabs.get(7).setVisible(false);}
}
The error I am getting is:
Unable to get value of the property 'setVisible':object is null or undefined
When I created the new tab the name was 'tab_7' so assume I have used the correct value in the code...
Thank you :)