How to hide a field with user roles
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2012 07:55 AM
Hi -
How can I hide a field on a form based on the user roles? I have created a role and assigned it to the field on the form but it's not working as expected.
Thanks.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2013 02:17 PM
[code]
function onLoad() {
var canSeeIt = g_user.hasRole('admin') || g_user.hasRole('engineering') || g_user.hasRole('field_services');
if (canSeeIt == true)
g_form.setDisplay('cmdb_ci', 'true');
else
g_form.setDisplay('cmdb_ci', 'false');
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2013 02:46 PM
Wow, thank you! works perfectly 😃