This onChange client script is not working on Service operation workspace problem record.

Praju_123
Tera Contributor
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
       if(newValue == "Hardware"){
        g_form.clearOptions('u_root_cause_subcategory');
        g_form.addOption('u_root_cause_subcategory','Cable','Cable');
        g_form.addOption('u_root_cause_subcategory','DiskDrive','DiskDrive');
        g_form.addOption('u_root_cause_subcategory','Storage Device','Storage Device');
    }
    else if(newValue == "Software"){
        g_form.clearOptions('u_root_cause_subcategory');
        g_form.addOption('u_root_cause_subcategory','Build','Build');
        g_form.addOption('u_root_cause_subcategory','Configuration','Configuration');
        g_form.addOption('u_root_cause_subcategory','Design','Design');
    }
}
3 REPLIES 3

Valmik Patil1
Kilo Sage

Hello ,

Please check the client script configuration

Edit the script and ensure the UI type is set to "All" so that it functions correctly across different user interfaces.

ValmikPatil1_0-1717134216014.png

In above screen shot it is set to desktop so it will only work on normal view,

if you set it to ALL then it will work on other view as well

Thanks,

Valmik Patil

 

dgarad
Giga Sage

Hi @Praju_123 

1.Set UI Type = All" on client script

2. Set the "Isolate Script" field on the client script to "True, " which should help resolve the issue.

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Community Alums
Not applicable

Hi @Praju_123 ,

Please make some changes I shown in below image

SarthakKashyap_0-1717138852123.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak