Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

JS Error: "unable to get value of the property 'setVisible': Object is null or undefined

$
0
0

I dont see any reason why this error is occuring. Its an OnChange error.

Here is how I set the function up...

function setFunctionTitle() {

       var setFunctionTitle = Xrm.Page.getAttribute("new_opportunitytype").getValue();

       if (setFunctionTitle != null) {

           var setFunctionTitle = Xrm.Page.data.entity.attributes.get("new_opportunitytype").getSelectedOption().text;

           Xrm.Page.ui.tabs.get("Tab 1").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 2").setVisible(false);

           Xrm.Page.ui.tabs.get"Tab 3").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 4").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 5").setVisible(false);

           switch (setFunctionTitle) {

               case 'Option 1':

                          Xrm.Page.ui.tabs.get("Tab 1").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 2").setVisible(false);

           Xrm.Page.ui.tabs.get"Tab 3").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 4").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 5").setVisible(false);

     break;

               case 'Option 2':

                              Xrm.Page.ui.tabs.get("Tab 1").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 2").setVisible(false);

           Xrm.Page.ui.tabs.get"Tab 3").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 4").setVisible(false);

           Xrm.Page.ui.tabs.get("Tab 5").setVisible(false);

Then this repeats to show / hide all of the rest of my options.

Does anyone have any thoughts on this?

Thanks!


Viewing all articles
Browse latest Browse all 82002

Trending Articles