Remove choice field when a specific value selected in a reference field.

1_DipikaD
Kilo Sage

Hi All,

When service field in change form is selected as "SAP Enterprise Services" remove choice "low" from Risk field except this addback the choice "low" to the Risk field for other values of service field.

 

I have tried the below onchange clientscript but did not get the desired result :-

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
   var service = g_form.getValue('business_service');
   var choice = 'risk';
   if(service ==26da329f0a0a0bb400f69d8159bc753d){
    g_form.removeOption(choice,'4');
   }

   //Type appropriate comment here, and begin script below
   
}
8 REPLIES 8

@1_DipikaD 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@1_DipikaD 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@1_DipikaD 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@1_DipikaD 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader