make fields in a specific tab editable only for a particular group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 07:28 AM
Hi
We have created some custom fields and added those fields in a new tab of the incident form. We have a requirement to make the fields in that editable only for the users of a particular group for other group users open the incident form the fields should be read-only.
Can someone advise me how can I achieve this.
Thanks in Advance.
Thanks,
Bhavani.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:08 AM - edited 08-16-2023 08:09 AM
@Bhavani13 ,
Please check these out. These references will help you with the scripts to identify whether a user is a part of a specific group or not on client side.
https://servicenowguru.com/scripting/user-object-cheat-sheet/
https://www.servicenow.com/community/developer-forum/ismemberof-function-in-client-script/m-p/144343...
and then you can make the field editable else read only based on the returned value.
In case you need to disable the editability on list view as well, you might need to have a list_edit ACL on desired column and you can do a check on the ACL with if gs.getUser().getUserByID(user).isMemberOf(<your group name here>) in the script there.