Make a True/False field required

Ruth Goodsell1
Tera Contributor

Is there a way to required a true/false field to be true in order to close a record?

16 REPLIES 16

Its a true/false field that I need to have require a true answer in order for the status to be set as Closed. 

 

You are right.

So you need an OnSubmit Client script as below

 

function onSubmit() {
    //Type appropriate comment here, and begin script below

    if (g_form.getValue('u_survey_sent') == 'false' || g_form.getValue('u_survey_sent') == false) {
        alert('<alert message>');
        return false;
    }
}

 

 

-Anurag

This is getting really close.  I only need to message to display is they are trying to change the state to closed.  I would still like them to be able to update the record in other ways

Please add the appropriate Field name and closed state value

 

function onSubmit() {
    //Type appropriate comment here, and begin script below
if(g_form.getValue('<state field name>') == '<Value of Closed State>')
{
    if (g_form.getValue('u_survey_sent') == 'false' || g_form.getValue('u_survey_sent') == false) {
        alert('<alert message>');
        return false;
    }
}
}
-Anurag

Community Alums
Not applicable

You can use an OnSubmit client script to verify that the value is true.