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

nthumma
Giga Guru

you can use UI policy to set fields to read only


That thing I was aware , based on catalog task state ,I should make read only


Hi Sandeep,



you need to write onChange() client script on your task table.



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


  return;


  }



  //Type appropriate comment here, and begin script below


  var statevalue=g_form.getValue('state');


  if(statevalue==2)


  {


  g_form.setReadOnly('variables.test',true);


  }



}



Please check the thread below.



Service Catalog UI Policy "Catalog Conditions" don't work




Thanks,


Harshvardhan




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


Actually I need to hide the few variables in RITM and Catalog task when the catalog state is closed complete so for RITM how I need to proceed ?