How to make fields mandatory in list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 10:03 AM
Hi Experts,
I want to make "Assigned To" Field mandatory in list view in state "In Use" , is there any way to add "Assigned To" field in below State and Substate in list view ?
Thank you.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 10:05 AM
Yes,
Use onCellEdit client script.
Long Live ServiceNow!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 10:17 AM
When you double-click on the state field on the list layout, the substate also is displayed below this. There's a reason for this.
The Substate is dependent on state, see below:
The same cannot be done for Assigned to.
You can make the Assigned to mandatory indirectly with Business Rule.
Use a Before Update BR that triggers when State changes to In Use.
In the script :
if(current.assigned_to == '')
{
gs.addErrorMessage('Assigned to is empty');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 12:39 AM
Thanks for your suggestion.
However in this way while changing the "Assigned To" , State is in incorrect condition.
Is there any way to update the record only when "Assigned To" and State both are selected in list view ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 08:45 AM
Unfortunately no 😞