Save Button on form to ignore mandatory fields and save

Amol Pawar
Tera Guru

Hi everyone!

 

I need to create a Save button that will appear on a form and save the record even if some mandatory fields have yet to be filled. The button should ignore the required fields and save the form.

 

Or

 

I need to create an alert message which will ask the user to save the details. If we click on Ok or Save on that alert, it should save the details on the form ignoring empty mandatory fields if there are any.

 

Let me know if you have any thoughts on this!

Thanks in advance, 

Amol

12 REPLIES 12

yuvarajkate
Giga Guru

For the first case you will need to create an UI Action and for the second case a Client Script will work with the condition that if the mandatory fields are empty set the mandatory to false (g_form.setMandatory('field_name', false)); and save the form.

 

Please mark this as heflpful/correct if it helped you in any way.

Hi @yuvarajkate,

 

Thank you for your response. Could you please provide some script for me to refer so that I can try?

 

Thanks in advance,

Amol

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Amol Pawar 

 

I need to create a Save button that will appear on a form and save the record even if some mandatory fields have yet to be filled. The button should ignore the required fields and save the form.

Atul: ServiceNow provides an OOTB save button, and you are actually trying to violate its purpose. We need to understand that every system has a way of working and must be used the same way. By ignoring the mandatory fields, you are creating a process issue as well as technical debt.

 

Or

 

I need to create an alert message which will ask the user to save the details. If we click on Ok or Save on that alert, it should save the details on the form ignoring empty mandatory fields if there are any.

Atul: Again not a valid use case and process violation. Don't increase the technical debt.

*************************************************************************************************************
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]

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