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

Mr_X
Mega Guru

Hi @sd2097 ,

 

Check for ACL which is table_name.field_name and operation is write and in the condition section you can specify the feild is 'Approved'.

 

If my solution works please mark it as helpful and don't forget to click thumbs up button!

Hi @Mr_X ,

 

Thanks for your reply. Actually there aren't any table_name.field_name acl for those fields.

Hi @sd2097 ,

 

Then create one as follows
Type: record

Operation: write

Name: table_name--->field_name

condition: field_name is Approved

 

If my solution works please mark it as helpful and don't forget to click thumbs up button!

Hi,

 

Actually I want the data to be read only if the field value is approved. Not the other way around. Can we do 'is not approved' instead?

Also, what should I give in the roles section? The same role that I gave in the previous acls?