is it possible to make a true/false field mandatory?

garethprice
Kilo Expert

I've been trying to make a true/false field mandatory on the Service Desk Call Plugin. I've tried a couple of variations of UI policies and the field shows with a grey star as if it was mandatory once but i'm unable to make the field mandatory if false and not mandatory if true

any suggestions?

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Although you can "make" a True/False field (checkbox) mandatory, it always contains a true or false value so it will always be considered to be filled in regardless of the status.   That's why you see the grey star - it's mandatory AND "filled in".



I always create a choice field with "Yes" and "No" options and include a blank option that fails the mandatory check.


View solution in original post

7 REPLIES 7

BALAJI40
Mega Sage

If it always mandatory means,


make it check box true in dictionary level of the corresponding field.


if it certain   condition then go for UI Policy or client script.


Nate23
Mega Guru

if you create an onSubmit client script you can add the condition in there:



name: mandatory true


type: onSubmit


script:



var myBoolean = g_form.getValue('variable_name');


if(!myBoolean){//this evaluates as if the checkbox is not checked


alert('This VARIABLE must be checked before saving');


return false;


}


Jim Coyne
Kilo Patron

Although you can "make" a True/False field (checkbox) mandatory, it always contains a true or false value so it will always be considered to be filled in regardless of the status.   That's why you see the grey star - it's mandatory AND "filled in".



I always create a choice field with "Yes" and "No" options and include a blank option that fails the mandatory check.


Thanks Jim, i've gone with this option