The CreatorCon Call for Content is officially open! Get started here.

how to make variable read only,when catalog task state is closed complete

swathikrishanan
Tera Contributor

making the field read only based on catalog task   state

1 ACCEPTED SOLUTION

You can write a client script on Task table onChange on field name State.



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);


}


View solution in original post

13 REPLIES 13

For the RITM , there are 4 tasks so for, when I close the task1 , RITM will not get closed , but the variable s should be read only here  


check the link below.



https://www.servicenowguru.com/scripting/business-rules-scripting/variables-form-readonly/



Thanks,


Harshvardhan




Hope this helps.Mark the answer as correct/helpful based on impact.


You can write a client script on Task table onChange on field name State.



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);


}


TiffanyL
Tera Contributor

Where I attempted to create a new UI policy, it wouldn't allow me to drill down to my list of variables. When I navigate to the field name list and add, there is only one selection for "variables".