Make fields read only based on condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 11:27 PM
Hi all,
I have a requirement where I want to make fields read only when the value of a field is set to 'Approved'. I have two write acls on that table for that role- one table level and one field level. How do I make the record read only for that role by manipulating the acl.
I also tried a script :
if(condition){
answer = false;
}
But this is making all the records read only irrespective of the conditions.
Any help would be appreciated.
Thanks,
Sudhangshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 03:48 AM - edited 10-17-2024 07:55 PM
Hi @sd2097 ,
Maintain the same roles as field level ACL and create a new field level ACL & then update the condition as below
field_name IS NOT Approved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 03:24 AM
Hi @sd2097 ,
Why don't you try onload client script to check field value is approved & current logged in user has the role to make other fields readonly on record.
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul
ServiceNow Rising Star 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 06:07 AM
Hi @Mayur2109 ,
Thanks for your response. Actually using client script will only work on the form. We want it to work for list as well. So that's the reason I am not going the client script way.