Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

In Customer service , if the state is cancelled , make everything readonly by client script.

prastuti
Tera Contributor
 
5 REPLIES 5

yashkamde
Mega Sage

Hello @prastuti ,

 

Make one client script on-change :

Screenshot 2026-02-25 113755.png

 

 

As a result on incident form states will be read only :

Screenshot 2026-02-25 113729.png

 

Code : 

if (g_form.getValue('state') == '8') {
        var fields = g_form.getEditableFields();
        
        for (var i = 0; i < fields.length; i++) {
            g_form.setReadOnly(fields[i], true);
			g_form.addInfoMessage('State cancelled fields are read only');
        }
    }

 

If my response helped mark as helpful and accept the solution.