- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 05:36 PM
Please I need help on how to make all fields read only on Request Record once an item is closed. State should still be editable for admin. Client do want to use scripting to achieve this. I tried to use UI Policy and ACL but no luck. Can someone help me with the detail on how to achieve this requirement please.
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2021 03:28 AM
The ability to edit all fields is different than my understanding of your original request, but that actually makes it easier. Delete the second rule on sc_request.request_state, and modify the first rule to check the Admin overrides box. Now an admin will be able to edit all fields (except Price) on open and closed Requests, and all users without the admin role will not be able to edit any fields on closed/inactive Requests.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 05:52 PM
Hi Ken,
Use can use below client script:
var fields = g_form.getEditableFields();
for (var x=0; x < fields.length; x++){
if (fields[x]!='state'){
g_form.setReadOnly(fields[x],true);
}
}
Hope this will help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 06:01 PM
You may have conflicting ACLs that are causing your ACL to not work properly . You can try running the security debugger to see which ACL is getting triggered on the page if you still want to try the ACL route.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 06:24 PM
Hi Ken,
The inherent problem with using any client-side action to do this - like a Client Script or UI Policy, is that there will always be a way around it - list editing, API, scripting, changing a field in the split second while the form is loading before it shows as read only,.... The best way to achieve record security is with an ACL. Filter your ACL list on Name = sc_request and Operation = write. Inactivate what ever is there then create a new one that looks like this.
The snc_internal role seems to get added when none are specified. Next, create another ACL that looks like this
When viewing a Closed REQ if there are any fields (other than State for Admin) that are editable then go back to the ACL list and filter on Name contains sc_request and Operation = write to quickly find the field specific one(s) overriding the new ones.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 06:54 PM
Thanks Brad, I did exactly what you proposed. But no luck.
The write ACL was deactivated, then create two new ACL BELOW With active = True
And This one
Can you let me know what I am doing wrong. I need all these fields to be editable by admin once the request state is closed.