Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

Not applicable

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 @Community Alums ,

 

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.