Quantcast
Channel: Sam's Activities
Viewing all articles
Browse latest Browse all 3363

Hiding a tab based on whether a field Contains Data or not

$
0
0

Hi everyone

I'm trying to show or hide a tab based on whether or not a field contains data.

The basic principle is if a field called Type contains data then tab_16 should show. If the field called Type does not contain data then tab_16 should not show.

I know that I have to do this in Javascript, and I believe that I might have got part of the way. However, I know that the second part of the code is wrong, but my experience of Javascript is very minimal! Could anyone help me with this please?

Also, how do I ensure that tab_16 shows if Type changes from not containing data to containing data?


function hideOrShowSubgrids() {

var taskTab = Xrm.Page.ui.tabs.get('tab_16');

//Time out function to wait untill the component loads.
if (taskTab == null || taskTab == "undefined") {
setTimeout(function () { hideOrShowSubgrids(); }, 1000);
return;
}

//Set the tab as visible if the Field "Type" contains data.
if (fieldname == "Type") {
Xrm.Page.ui.tabs.get('tab_11').setVisible(true);
}
}



Many thanks
Jon


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>