Option removing client script not working in workspace

snow_beginner
Mega Guru

Hi,

So I had a requirement to change the drop down values for the 'resolution code' field on the incident form. The new fields to be added were these below and I was able to do that easily.

 

solution provided

workaround provided

no resolution provided

 

The previous options that were there, they did not want them to be user selectable (they needed to be hidden on load) but be available for integrations. I was able to do that using a client script below

 

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   g_form.removeOption('close_code',"Solved (Work Around)");
   g_form.removeOption('close_code',"Solved (Permanently)");
   g_form.removeOption('close_code',"Solved Remotely (Work Around)");
}

 

This entire thing is working fine in UI16 but not working in service operations workspace. What can I do to fix it please?

1 ACCEPTED SOLUTION

Also Make sure that UI type on the client script has ALL Selected in it

AnuragTripathi_0-1709894339180.png

 

-Anurag

View solution in original post

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

Looks like you are using the remove option with the labels, can you try the same with value?

  g_form.removeOption('field name', 'choice value');
-Anurag

Also Make sure that UI type on the client script has ALL Selected in it

AnuragTripathi_0-1709894339180.png

 

-Anurag

Hi @Anurag Tripathi the value and the label is the same. But selecting the UI type to all has resolved the issue. thanks so much!