How to make a true/false (boolean) field mandatory?

chr_kluge
ServiceNow Employee
ServiceNow Employee

Hi everyone

 

Did some of you face the same problem?

In the change_request I would like to make "production_system" mandatory. As it is a True/False field and I don't want to change the type I tried to configured a choice list with none. But it isn't working either for the choice values "0" and "1" or for the values "true" and "false.

How can I achieve this?

 

Thanks a lot

Christina

10 REPLIES 10

Anurag Tripathi
Mega Patron
Mega Patron

I dont get the requirement here. if you make the checkbox mandatory , outcome will always be true only. There cannot be a scenario where user can mark it false.


I think you should use a dropdown (select box) with yes/no/none values and make that as mandatory.


-Anurag

HI Anurag



The business case is: we don't want force in a certain workflow step the responsible user(s) to think about the flag.


And as you said for a flag the attribute mandatory makes no sense. But SNow decided to make it a boolean not me.



Thanks


Christina


jadona
Giga Contributor

You can create an onSubmit client script, and set a code similar to:



if (g_form.getValue("u_checkbox")=='false'){


  alert(getMessage("Please, accept the terms and conditions by clicking the checkbox"));


  g_form.showFieldMsg('u_checkbox',getMessage("Accept terms and conditions"),'error');


  return false;


} else {


  g_form.hideAllFieldMsgs('error');


}


chr_kluge
ServiceNow Employee
ServiceNow Employee

Hi everyone



Thanks for your input


I think I have to create a custom field. I just hoped I could avoid it.



BR


Christina


Hi Christina,



        Can we make True/False Boolean field Mandatory. If yes How can we make it??



Thanks,


Manideep Nadimpelli.