What is the best practice to make a field mandatory?

Suggy
Giga Sage

Hello,

What is the best practice to make a field mandatory?

 

Scenario is that, we have made a field mandatory at dictionary level in Default View for a table called 'X'. This table has 10 different views.

Above field is present only in DEFAULT VIEW,

 

Users are changing the view and submitting the from, they by skipping the mandatory field.

 

PS - I know that we can write BR use setAbortAction(true);

Should we go with a BR approach (in which case we need to write SEVERAL BRs for all the tables that we are using today) or is there any other better approach?

1 ACCEPTED SOLUTION

Amit Verma
Kilo Patron
Kilo Patron

Hi @Suggy 

 

Please give this a try using a Global UI policy on your field which makes the field mandatory across all the views. Refer below posts which might give you more ideas :

https://www.servicenow.com/community/itsm-forum/make-a-field-read-only-in-one-view-that-already-is-m...

https://www.servicenow.com/community/grc-forum/how-to-make-field-mandatory-based-upon-view/td-p/2579...

https://www.servicenow.com/community/developer-forum/making-a-mandatory-field-visible-on-self-servic...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Suggy 

 

Any reason, why we are not making this field mandatory in all views?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Harish KM
Kilo Patron
Kilo Patron

Hi @Suggy as far as i know if the field is not made visible on the form, the mandatory will not be applied since the field is not present on the form. so you need to bring the field on the form for all views.

The alternate way is via Business rule to abort the action if field is not filled

Regards
Harish

Amit Verma
Kilo Patron
Kilo Patron

Hi @Suggy 

 

Please give this a try using a Global UI policy on your field which makes the field mandatory across all the views. Refer below posts which might give you more ideas :

https://www.servicenow.com/community/itsm-forum/make-a-field-read-only-in-one-view-that-already-is-m...

https://www.servicenow.com/community/grc-forum/how-to-make-field-mandatory-based-upon-view/td-p/2579...

https://www.servicenow.com/community/developer-forum/making-a-mandatory-field-visible-on-self-servic...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Wondering how I missed Data policy. This is simpler compared to BRs.

Thanks @Amit Verma  🙂