- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 07:56 PM
Hi All,
how we can restrict dropdown values in the list view
Table: Incident
Field: State
Field value ‘Closed’ should be visible only for Admin user in both form view and list view (In form view, this is already in place, need to do it in list view as well).
Regards,
Tharun
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 10:30 PM
Hi,
So only admins should be able to change State to closed
update BR condition as this
current.state == 7 && !gs.hasRole('admin')
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 09:56 PM
Hi,
you can also use before update BR
Condition: current.state == 'closed' && !gs.hasRole('admin')
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addErrorMessage('You are not admin so cannot set state to closed');
current.setAbortAction(true);
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 10:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 10:30 PM
Hi,
So only admins should be able to change State to closed
update BR condition as this
current.state == 7 && !gs.hasRole('admin')
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 12:00 AM
Hi Ankur,
How to hide the value ‘Closed’ from the choice list.
Regards,
Tharunkumar A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 01:06 AM
Hi,
I could see you marked my response as correct earlier and now it is not.
If my response helped you please mark it correct
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader