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.

Best way to enforce mandatory fields in list control insert

thisisauniqueus
Giga Expert

Hi,

i want the user to be able to insert a new record from the list view control. The BR i have defined on my table for the form will work as usual(or so is my understanding, plz advice if otherwise). Now in my table i have some fields that are not mandatory but using the UI policies i am making them mandatory based on some calculations and other fields. Is there a way i can enforce the mandatory fields constraint on the list view control insert?

what i have planned is to have a BR on before insert, and in that i will check for all the mandatory fields values and if some field is missing a value ill setAbortAction to true.

Please suggest a better approach if possible.

Regards

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Convert the UI policy to Data policy .. That should work


View solution in original post

5 REPLIES 5

Kalaiarasan Pus
Giga Sage

Convert the UI policy to Data policy .. That should work


Inactive_Us1474
Giga Guru

Also note in list control editing , the BR does not run. You can use the onCellEdit client script / Data Policy as suggested by Kalai for making fields as mandatory.



Thanks and Hope it helps.


Akhil


BR is a servers side trigger. It will run however the record is updated. It could be via form, list, web service , etc