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

John Zhang1
Kilo Patron
Kilo Patron

Please see following client script.  Let me if you have any question.

John Zhang1
Kilo Patron
Kilo Patron

The following is a simple approach

find_real_file.png

I tried this for the "Assignment group" field of the Incidents List View, but it works partially;

- With this Client Script activated, you cannot leave the "Assignment group" field empty.
- But.. you also cannot do any other input and this last detail is a big one, a big issue. 

How can I solve this?

 

My Client Script details:
- Table = Incident
- UI Type = Desktop
- Type = onCellEdit
- Field name = Assignment group
- Script:

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;

//Type appropriate comment here, and begin script below
g_form.setMandatory('assignment_group', true);

callback(saveAndClose);
}

John Zhang1
Kilo Patron
Kilo Patron

find_real_file.png