Help creating an ACL to prevent users from editing a field if a condition is met.

Matthew20
Tera Contributor

Hello,

I am looking into making the STATE field on PROBLEMS read only when the record is closed. Obviously thats easy enough to do with UI POLICY or DATA POLICY but neither of those will stop people from editing the field through the LIST VIEW. I really don't want to go as far as editing ACL's to solve the problem. Is there a solution that doesnt involve ACL?

 

If I need to create an ACL I assume it would look something like

Record

List_edit

Problem.State

State is Closed/Resolved

Admin overides would be off and the requires role would be admin. 

 

When i tested this though, a non admin user was getting the opposite effect, They could edit when the state was closed/resolved but not when open.

 

Any help would be appreciated. Thank you.

1 ACCEPTED SOLUTION

hi @Matthew20 you can write onSumbit Client Script to make it ReadOnly on form submission.

if(g_form.getValue('state')=='closed'){
g_form.setReadOnly('state',true);
}
else{
g_form.setReadOnly('state',false);
}

Regards,

Siddharam

View solution in original post

4 REPLIES 4

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Matthew20 please follow below screenshots 

SiddharamTakali_0-1713279756188.png

SiddharamTakali_2-1713279823764.png

 

Please Mark my answer correct/Helpful

Regards,

Siddharam 

Thank you, the help is much appreciated. After working on it more the need has changed so maybe I can trouble you for more help. 

 

It seems locking out the field on the form is enough, but i cant seem to get the condition right. Currently i have what you see below, but it works on change and on load so as soon as the user changes the state it makes it read only. I would like it to work when the condition in the screenshot is met and the record is save/updated, that way they can unselect the closed option if they made a mistake.

Matthew20_0-1713294931831.png

 

 

 

Can this be done without a script and if it requires a script can you provide some guidance? Thanks in advance for youre help.

hi @Matthew20 you can write onSumbit Client Script to make it ReadOnly on form submission.

if(g_form.getValue('state')=='closed'){
g_form.setReadOnly('state',true);
}
else{
g_form.setReadOnly('state',false);
}

Regards,

Siddharam

Thanks for the help!