- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 11:20 AM
I have a Form button UI Action that I'm trying to narrow a condition for. I currently have it written as:
g_user.hasRoleExactly('help_desk') && (current.state != '6' && current.state != '7' && current.state != '8')
This is not working. I have broken it up and tested each condition individually, all of the state checks work fine but the role check will not even work on its own. I have also tested using the basic hasRole() and that works fine, but due to admin privileges need to use hasRoleExactly. Does anyone have any experience using this function that might be able to give me some insight as to why this isn't working?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:21 PM
I stand corrected. As I mentioned earlier you can only use server side code in the conditions. Try my code as mentioned in my previous response
(gs.getSession().getRoles().indexOf('help_desk') >-1) && (current.state != '6' && current.state != '7' && current.state != '8')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 11:50 AM
Wondering why your condition was not working. According to the documentation your condition is correct, you can write both client side and server side in conditions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:04 PM
Interesting. Let me try to replicate it on my end.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:21 PM
I stand corrected. As I mentioned earlier you can only use server side code in the conditions. Try my code as mentioned in my previous response
(gs.getSession().getRoles().indexOf('help_desk') >-1) && (current.state != '6' && current.state != '7' && current.state != '8')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:26 PM
There is not hasRoleExactly() method to the getUser() object

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:30 PM
Did you try my code? Were you able to get this working?