Can't make all variables read only on close

Abbottronix
Tera Guru

I have a client script to make all the fields and variables on my catalog task read only when the task is closed. While it works on most of them, it doesn't seem to work on the reference field variables.

 

Abbottronix_0-1723771724967.png

 

Abbottronix_1-1723771871670.png

Can anyone advise how I can make those reference field variables read only as well?

 

1 ACCEPTED SOLUTION

Najmuddin Mohd
Mega Sage

Hi @Abbottronix ,

There is already an OOB Client script written on sc_task table to make variableEditor read - only. Modify it according to your requirement.


NajmuddinMohd_0-1723773659469.png


Here, instead of making fields individually read-only, we make the complete variable editor read only.

g_form.setVariablesReadOnly(true);




If this information helps you, mark is as Helpful.

Regards,
Najmuddin.

View solution in original post

2 REPLIES 2

Najmuddin Mohd
Mega Sage

Hi @Abbottronix ,

There is already an OOB Client script written on sc_task table to make variableEditor read - only. Modify it according to your requirement.


NajmuddinMohd_0-1723773659469.png


Here, instead of making fields individually read-only, we make the complete variable editor read only.

g_form.setVariablesReadOnly(true);




If this information helps you, mark is as Helpful.

Regards,
Najmuddin.

Sandeep Rajput
Tera Patron
Tera Patron

@Abbottronix Instead of handling this via a client script, you should use an ACL instead. ACL not only works at a form level but also works on List. You can define a read ACL on your table which checks the state of the record in condition builder and returns answer=false in the script field.