Make fields read only based on condition

sd2097
Tera Guru

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

7 REPLIES 7

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

Mayur2109
Kilo Sage
Kilo Sage

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

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.