While creating the job application form in Salesforce, I need to add a validation so that if the applicant selects the “Certification Done” checkbox, they must also provide details in the “Certificate” field.
This ensures that applicants who have completed a certification must enter the certificate name or details before saving the record.
The validation rule will prevent the user from saving the record if the checkbox is selected and the certificates field is empty.
In this article, we will learn about the Salesforce checkbox validation rule. In this, I will create a validation rule for a checkbox and explain how it works in a real-time scenario.
Why use the Checkbox Validation Rule in Salesforce?
A checkbox validation rule is useful when you want to ensure that if a user selects (checks) a checkbox, they must also provide other required information before saving the record.
As we saw in the above scenario, if a user checks the “Certification Done” checkbox, it means they must have a certificate.
- Without a validation rule, a user could check the box but leave the certificate field blank, which creates incomplete data.
So here, the checkbox validation rule makes another field required only when the user selects the checkbox. This ensures that additional details are provided whenever the checkbox condition is true.
- With a validation rule, when a user checks the checkbox, they must also provide the certificate details; otherwise, Salesforce will not allow the record to be saved.
Add Salesforce Checkbox Validation Rule
Below, I will explain how to add a checkbox validation rule in Salesforce so that whenever a user checks the checkbox, they must also fill in the related field. If they don’t, Salesforce will stop them from saving the record.
- Before adding the validation rule, if a user checked the ‘Certification Done‘ checkbox but did not fill in the ‘Certificate‘ field, Salesforce still allowed the record to be saved.

- Here, you can see that the record has been successfully created without any errors.

- Now let’s add a validation rule on the checkbox field to display an error message when the checkbox is checked and another field has a Blank Value.
- For that, click on “Setup.” -> Select the Object Manager tab ->Select the Object on which you want to create the Validation Rule. Here, I’m going to create a Job Application custom object.
- Now select the Validation Rules and click the New button to create the new validation rule.