I want to show new choice in the suspend reason dialogue box which appears when I select suspend case.

Abhinav Dubey
Tera Contributor

I want to show new choice in the suspend reason dialogue box which appears when I select suspend case. Out of box there are four fields User, Company, Group and Others. I want to create two new options (example not completed and not escalated) and for new HR service only these options should show I want to hide all out of box options and display these

4 REPLIES 4

Mohit Kaushik
Mega Sage

Hi Abhinav,

You can use onChange Client script and show hide the options present in your choice field based with the help of below script.

g_form.clearOptions('<FIELD_NAME>'); // to remove all the previous options.
g_form.addOption(<fieldName>, <choiceValue>, <choiceLabel>, <targetIndex>); // to add new options.

You can use tha addOption to add as many options as you want to.

 

Note: This will only hide and add new options for the particular record based on your conditions.

 

Below link you can use for reference.

https://servicenowguru.com/scripting/client-scripts-scripting/removing-disabling-choice-list-options/

 

Mark this as helpful and correct if it solves your query.

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

I tried this but It is not working for the suspend reason choices as they are a part of different UI Page than the current HR service page

Mrman
Tera Guru

@Abhinav Dubey  You can create new choice in sys_choice table . Please see below screenshot .Once you add here it will be shown on the Suspend UI page .

 

Please test and mark my answer as correct .

 

find_real_file.png

sowmya29
Tera Contributor

How we can check in UI page that added choices has been captured ?