how to update ritm variable value based on checkbox variable value.

Bindhu1
Tera Contributor

Hi,

I have requirement say there is a variable checkbox on catalog item, if box is checked, 'Element' variable field will be filled with word 'Pending'.

what are the ways we can achieve this ? kindly help, Thanks.

 

 

 


 

1 ACCEPTED SOLUTION

Peter Bodelier
Giga Sage

Hi @Bindhu1 

 

You can use a onChange catalog client script on the checkbox field:

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
   
if (newValue == 'true'){
	g_form.setValue('client_wbx_element', 'pending');
}
   
}

 

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

3 REPLIES 3

Peter Bodelier
Giga Sage

Hi @Bindhu1 

 

You can use a onChange catalog client script on the checkbox field:

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
   
if (newValue == 'true'){
	g_form.setValue('client_wbx_element', 'pending');
}
   
}

 

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Thanks ! ,this should be inside ' '

if (newValue == 'true')

 i have one more question here, there is string field "xyz' on ritm which copies the 'Client WBS Element' variable field value, when there is an update to 'Client WBS Element' variable how to get the same update on string field "xyz' on ritm.

Hi @Bindhu1,

 

I've updated my answer to include this.

 

You can also use a catalog client script here, onchange on the Client WBS Element, although I may be missing the point, why there should be two fields holding the same value.

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
   	g_form.setValue('xyz', newValue);
  }

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.