web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2012 - Hiding Tabs/Sections using JAVA

(0) ShareShare
ReportReport
Posted on by 280

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 :)

*This post is locked for comments

I have the same question (0)
  • Atilin Profile Picture
    on at

    Hi

    try with this

    Xrm.Page.ui.tabs.get(6).setVisible(true)

    or

    Xrm.Page.ui.tabs.get("tab_7").setVisible(true)

  • Charlotte Henighan Profile Picture
    280 on at

    This didn't seem to do anything.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans