- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 10:00 AM
When hiding a value in the incident state dropdown for certain roles, is it possible to do this with a server-side script? I am aware you can use the "onLoad" functionality of client-side scripting.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 11:02 AM
Hi Greg,
I successfully accomplished this via ACLs. For some reason, it wouldn't let me create a before query Business Rule on the sys_choice table and I didn't dig any further than that. Here is what I did:
1. Enable high security
2. Navigate to System Definition > Choice Lists
3. Open the sys_choice READ ACL with the description "open up choice rows to everyone to allow everyone to read label field".
4. Add a script to it similar to:
answer = true;
// If has role and the choice is closed (value = 7)
if (gs.hasRole('role here') && current.value == 7 && current.name == 'incident' && current.element == 'state') {
answer = false;
}
Admin users and those with the role to personalize choices will still see closed due to the admin override and the other READ ACL that is role based. So impersonate an appropriate user to test. Good to know this will work.
Edit: Modified the condition in the script to account for the table and field the choice applies to, in this case the state field on the incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 11:02 AM
Hi Greg,
I successfully accomplished this via ACLs. For some reason, it wouldn't let me create a before query Business Rule on the sys_choice table and I didn't dig any further than that. Here is what I did:
1. Enable high security
2. Navigate to System Definition > Choice Lists
3. Open the sys_choice READ ACL with the description "open up choice rows to everyone to allow everyone to read label field".
4. Add a script to it similar to:
answer = true;
// If has role and the choice is closed (value = 7)
if (gs.hasRole('role here') && current.value == 7 && current.name == 'incident' && current.element == 'state') {
answer = false;
}
Admin users and those with the role to personalize choices will still see closed due to the admin override and the other READ ACL that is role based. So impersonate an appropriate user to test. Good to know this will work.
Edit: Modified the condition in the script to account for the table and field the choice applies to, in this case the state field on the incident table