Restrict choice field value on the basis of selected value

VishwamitraM
Tera Expert

Hi,

I have a custom table on which there is a choice type field(workstatus)which has values as:

1- Available

2-Not Available

3-Approved

4-In progress

I want that when the workstatus is Available, the drop down should show only "Not Available", means only Not Available is allowed to select.

When the work status is In progress, it should only show Approved value in choice list.

 

I created a client script to do this but it only works on the form i.e., when the record is opened on the form.

But on the List view it displays all the choice values.

How to implement this? Please guide.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@VishwamitraM 

that's correct the onChange client script won't work in list.

Anyhow what sense it makes to hide the other option as it's a drop down, so only 1 choice can be selected at a time.

Please explain your business requirement in detail

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi Ankur,

The requirement is that i want to restrict the visible choices in the workstatus dropdown so that users can only see the allowed transitions based on current status.

 

@VishwamitraM 

I don't think it's a valid business requirement.

I already explained the reason

If my response helped please mark it correct and close the thread so that it benefits future readers.

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