setting variables to read only once approved

Ramel
Mega Guru

Hi All, Need a little help why my onload script does not work. My concern is to be able to set the variables to read only after approval. Anyone can confirm about my 'if' statement? It doesn't work. function onLoad(){ //Type appropriate comment here, and begin script below if(g_form.getValue('approval' == 'approved')){ g_form.setReadOnly("variables.variable_name", true); I tested without the if condition and the field is being set to ReadOnly, so I can confirm that my if statement is incorrect. Anyone can advise? Thanks in advance. Ramel

1 ACCEPTED SOLUTION

Ramel
Mega Guru

My issue was resolved by using g_form.getReference('parent'); then if condition which is approval = approved. With that I was able to set the variables in the task as readonly after approval.



Thanks all for the replies


View solution in original post

23 REPLIES 23

BALAJI40
Mega Sage

g_form.getValue('approval') == 'approved'{


g_form.setReadOnly("variables.variable_name", true);


}


Hi Balaji, I have tried the code and the variables are still editable. Thanks. Ramel


bernyalvarado
Mega Sage

Hi Ramel,



Have you considered using a Catalog UI policy for this?



Thanks,


Berny