- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 05:50 AM
I can't seem to find either a UI Policy or Client Script that will allow me to hide a Catalog Item label - everything I am seeing is more modifying a label not hiding it. I am trying to do so by Role.
>Using the 'Read roles' function on the label variable has no effect.
>This doesn't work:
function onLoad() {
var rol = (g_user.hasRoleFromList("bpad,dabi,himc"));
if (rol)
g_form.setVisible('label', 'true');
else
g_form.setVisible('label', 'false');
}
>I tried using different flavors of document.getElementById('4f1faae46f5d9e407c7927ee2c3ee4cd') but that got me nowhere.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 06:33 AM
What is the name of that label variable, and is the name unique compared to all the other variables on the form?
You should be able to use its name like:
g_form.setDisplay('mylabel', false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 06:51 AM
Ok, you're correct
g_form.setDisplay(LABELNAME, false);
Helps if you have unique label names >.<

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 06:58 AM
Definitely! I've spent way too long troubleshooting variable issues in the past when I've had variables or variable sets named the same. Frustrating.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 07:00 AM
I don't get why setDisplay would work but SetVisible wouldn't but whatever.
This did work:
function onLoad() {
var rol3 = (g_user.hasRoleFromList("bpad,dabi,himc"));
if (rol3){
//$('label_IO:4f1faae46f5d9e407c7927ee2c3ee4cd').hide();
g_form.setDisplay('label_internal', true);
}
else {
g_form.setDisplay('label_internal', false);
}
}