Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to make fields mandatory in list view

kambleneeta20
Giga Expert

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 ?

 

find_real_file.png

 

Thank you.

8 REPLIES 8

AnirudhKumar
Mega Sage

Yes,

Use onCellEdit client script.

 

 

Long Live ServiceNow!

AnirudhKumar
Mega Sage

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:

find_real_file.png

 

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);
}

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 ?

 

Unfortunately no 😞