Hide options and add options in Suspended Reason in Dialog box

ss123
Tera Contributor

Hi All,

Can we hide options/add options in "Reason" field when "Suspend" button is clicked based on HR Service ?

I created an OnLoad Client Script, seems working on the form field. However, in the dialog/pop box, it's not updated.

 

I checked that the dialog box is configured in the UI Page "HR Suspend Dialog", can you help me update the choices based on case HR Service?

Thanks.

10 REPLIES 10

Gangadhar Ravi
Giga Sage
Giga Sage

@ss123  Can you please provide script you created. Also is it choice filed?

Here is my script:

function onLoad() {
    //Type appropriate comment here, and begin script below
    var hrservice = g_form.getValue('hr_service');
    if (hrservice == '03de5e4c1b40f510b0ceda48cc4bcbe3') {
        // g_form.clearOptions('sla_suspended_reason');
        g_form.removeOption('sla_suspended_reason', 'Requester: Missing information in terms of matters disclosed.');
    }
}
 
Suspended reason field is an OOB - String field with choices.

The script is only working on the case form, but not in the pop up dialog box.

 

ss123_1-1726475991262.png

ss123_2-1726476013434.png

 

 

SN_Wizard
Tera Contributor

Step-by-Step Solution for Updating "Reason" Field Choices in HR Suspend Dialog Based on HR Service

 

Solution:

1. Go to Tables:
- Navigate to the Tables section in ServiceNow.

2. Search for the "sys_choice" Table:
- In the filter navigator, search for the table named `sys_choice`.

3. Go to List View and Apply Filters:
- In the `sys_choice` list view, apply filters:
- Table: `sn_hr_core_case`
- Element: `sla_suspended_reason`

4. Add/Modify Options:
- Now, you can add or modify the options in this list. These options will then populate in the dialog box when the "Suspend" button is clicked, reflecting based on the HR Service.

---

Mark my answer helpful & accepted if it helps you resolve your query.

Thanks,
Siddhesh Jadhav