ACL for a particular field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2022 04:12 AM
Hi
need your help to implement an ACL with the logic as -
I have created a new field " xyz" with a checkbox on a particular form using type true/false. My form is having three fields as support manager, responsible manager and a support group.
Now the requirement here is the newly created field with the checkbox can be checked or unchecked only by the support manager , responsible manger or any member of that support group that a form is having. For other users it should be a read only field..
pls help how can I proceed with this. I know we can do via write ACL but help with the script and logic for the reference.
Thanks
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2022 05:34 AM
Hi Ankur ,
solution is not working , the field is still grey-out in all the cases.
I have checked by impersonating the members but the field is not editable for them as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2022 05:38 AM
Hello Utkarsh,
Please check my comment it should work
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2022 05:41 AM
hey Saurav,
Thanks for providing the solution . I have tried yours as well but it is not working .
Can you suggest any other way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2022 05:59 AM
Hi,
Did you check any other client script OR ui policy is making it readonly?
script line I shared should work fine provided you are using correct field names
answer = gs.getUser().isMemberOf(current.support_group) || current.responsible_manager == gs.getUserID() || current.support_manager == gs.getUserID();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
