Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

State Field Read Only when state is closed complete in catalog task

Swathi P
Tera Guru

Hi All,

 

We have a requirement On selecting state as closed incomplete/skipped/closed, State field  should get greyed out once we have saved the task form with state as closed.

 

I wrote a write ACL to make state field read only  once the state moves to Closed Complete it is not working properly. I could still find catalog task state field as editable. Is there any mistake ?

find_real_file.png

find_real_file.png

6 REPLIES 6

Debasis Pati
Tera Guru

hi write one catalog client script.

var catalogitem = g_form.getValue('u_item');

 

if(catalogitem=='Your catalog Item')

 

if(newValue==closedvalue && catalogitem=='Your Catalog Item')

 

{

 

g_form.seReadOnly('variables.Yourvariablename',true);

 

}

 

Please mark it as correct if it resolves.

 

Regards,

Debasis

Swathi P
Tera Guru

Hi All,

 

Thank you for the reply. If i use the UI Policy as soon as i change the state to closed state is getting readonly. But my requirement once i submit the record then, it should be read only.