How to clear values based on selection of choice values

Srinivasu2
Tera Contributor

Hi Community,

 

How to clear values based on selection of choice values in catalog item

we have 3 variables in catalog item.

1. Brazil - SAP    :               Select list (around 10 choices are there)

2. Business justification:  Multiline text

3.  Provide a detailed description of your request/query:  Multiline text

 

If i select one choice and select values in other 2 variables than go to other choice, Previous values in other variables are not cleared.

 

It always shows previous values so Could you please suggest how to clear values even if we select different choices in select list.

 

Srinivasu2_0-1696604981447.png

Srinivasu2_2-1696605062583.png

Could you please check the above screenshots and advise how to clear values?

 

Thanks & Regards,

Srinivasu

 

 

 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

You can write a on change catalog client script on the Brazil-SAP field. Use the below code for the same:-

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
g_form.clearvalue('replacevaribale2');
g_form.clearValue('replacevaribale3');
}

 

Please mark my answer as correct based on Impact.

View solution in original post

1 REPLY 1

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

You can write a on change catalog client script on the Brazil-SAP field. Use the below code for the same:-

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
g_form.clearvalue('replacevaribale2');
g_form.clearValue('replacevaribale3');
}

 

Please mark my answer as correct based on Impact.