Make record read only when specific assignmend group is assigned
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 04:32 AM
Hi all,
what I need to do that when a record is assigned to the group: Controlling than I want that this group has only read-only access to this record.
How can I achieve this requirement?
Thanks for help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 04:37 AM
Hi @JohnDF ,
You can create a UI policy and use conditions as
Assignment group is not empty
Use the below code in Run Script
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
Thanks!
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 04:43 AM
Hi @JohnDF
You can create a write ACL at table level with the following script condition.
answer = (!(current.assignment_group.name == 'Controlling' && gs.getUser().isMemberOf('controlling')))
Please mark my answer helpful and accept as solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 05:24 AM
@Anvesh thanks for reply.
I did this.
And than I impersonate the user of the the controlling group if he open a case assgned to this assignment group the caseis still not read only.
Did I miss something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 09:14 AM
Can you also try creating another ACL at record level (<tablename>.*)
And also check if there are any other ACLs which are allowing the user to have write access.
Anvesh