- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 04:33 PM
Hello,
I am trying to hide a choice list value Category(category) on the work order form from a specific role.
I tried creating a onLoad client script but I must be doing something wrong because it is not working.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 05:32 PM
uncomment the line number 6 and check logged user has role or not .
What it is giving . Is it true or false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 04:41 PM - edited 01-12-2024 04:42 PM
@Rhonda9 Please update your script as follows.
function onLoad(){
if(g_user.hasRole('wm_security')){
g_form.removeOption('category', 'electrical');
}
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 05:11 PM
Thank you for your response but it is not working. I can still see electrical.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 05:32 PM
@Rhonda9 Could you please right click on the field name category(category) and confirm if the field name is category or something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 05:33 PM
It shows 'category'