We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Restrict a type of state to only one item

LarissaR4486026
Tera Contributor

I wanted to know how I can make the Pending state appear only on a specific item without showing up on the others. Is that possible?

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron

You can create an onLoad Client Script on whatever table you're referring to:

function onLoad() {
    if (g_form.getValue('cat_item') == '<sys_id of specific catalog item>') {
        g_form.removeOption('state', -5);
    }
}

Where cate_item is the name of the field that determines the 'specific item', and -5 is the value of the Pending choice.

View solution in original post

6 REPLIES 6

Nayan ArchX
Tera Guru

Use UI Policy Show/Hide the “Pending” Option

 

1) Create a UI Policy

  1. Navigate to: System UI > UI Policies

  2. Click New.

  3. Conditions:

    • Table: Incident (or the table where you want Pending)

    • Condition: true (always apply when on Incident)

  4. Save.

2) Add UI Policy Action

  1. Under the UI Policy, click New in the UI Policy Actions related list.

  2. Set:

    • Field name: state

    • Visible: Checked (if you want to show Pending)

    • Mandatory / Read-Only: as required

  3. Save.

If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!

 

Thanks

Nayan Patel

IT ServiceNow Consult, ServiceNow ArchX

If my response has resolved your query, please mark it Helpful by giving it a thumbs up and Accept the Solution

 

Ankur Bawiskar
Tera Patron

@LarissaR4486026 

please share some screenshots

what did you start with and where are you stuck?

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