Salesforce Checkbox Validation Rule with Examples : Shubham
by: Shubham
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Salesforce Checkbox Validation Rule When creating a job application form in Salesforce, it's important to ensure that if an applicant selects the "Certification Done" checkbox, they must also fill in the "Certificate" field. This prevents incomplete data entries. To enforce this requirement, a validation rule can be set up. This rule will stop users from saving the record if they check the checkbox but leave the certificate field empty. The validation rule uses a formula that checks if the checkbox is selected and if the certificate field is blank. If both conditions are true, an error message will appear, preventing the record from being saved. ### Steps to Create the Validation Rule 1. **Navigate to Setup**: Go to the Object Manager in Salesforce. 2. **Select the Object**: Choose the Job Application custom object. 3. **Create a New Validation Rule**: Click on the Validation Rules section and then the New button. 4. **Enter Rule Details**: Provide a name for the rule and ensure it is active. 5. **Add Logic**: Use the following formula: ```plaintext AND( Certification_Done__c = TRUE, ISBLANK(Certificate__c) ) ``` 6. **Error Message**: Specify an error message that will display when the validation fails. 7. **Error Location**: Choose where the error message will appear (either at the top of the page or next to the relevant field). 8. **Save the Rule**: Click the Save button to apply the validation. ### Proof of Concept After implementing the validation rule, if a user tries to save a record with the "Certification Done" checkbox checked but without entering certificate details, Salesforce will prevent the record from being saved. Once the user provides the necessary certificate information, the record can be saved successfully. ### Conclusion This validation rule ensures that users provide complete information when they indicate they have completed a certification. It enhances data integrity within Salesforce by preventing incomplete submissions. ### Additional Information - **Importance of Validation Rules**: They help maintain data quality and ensure that all necessary information is collected. - **Related Topics**: Users may also want to explore other validation rules, formula fields, and how to bypass validation rules using Salesforce Flow. ### Hashtags for SEO #Salesforce #ValidationRules #CheckboxValidation #DataIntegrity #SalesforceTips #JobApplicationForm #SalesforceDevelopment #SalesforceAdmin #CRM #SalesforceBestPractices
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.

- Now, enter the Rule Name and check the Active checkbox to apply the rule. Then, enter the logic for Error Conditions in the Formula Editor.
AND(
Certification_Done__c = TRUE,
ISBLANK(Certificate__c)
)
- In the above formula, we have used the AND() function, which checks all conditions inside it. If the condition is true, then we will throw an error, which will prevent the record from being saved.
- Certification_Done__c = TRUE: If user has checked this field that means they has done certification.
- ISBLANK(Certificate__c): Additionally, if the user has done certification but does not provide the certificate names, an error will be triggered.
Click “Check Syntax” to ensure the formula is correct.

- Error Message: Now, enter a message to display an error when the user enters incorrect details.
- Error Location: Where the error message should display on the screen. For that, we have the following two options.
- Top of Page: The error message will display beside the Save button.
- Field: The error message will display on a particular field for which we apply validation.
- Then click on the Save button.

In this way, we can create the validation rule on a checkbox field in Salesforce. To apply this validation, ensure that the rule is activated.

Proof of Concept:
Now, let’s navigate to the Job Application object and try to create a record by checking the Certification Done checkbox without providing the Certificate details.
Earlier, the record was getting saved, but now Salesforce prevents the record from being saved until the required information is entered.

Now, let’s provide the certification details and try again. Click the Save button to create the record.

You can see that this time, Salesforce allows the record to be saved successfully because both the checkbox is checked and the required Certificate field is filled in.

In this way, we can use the checkbox validation rule in Salesforce to make the other field required if the checkbox is checked.
Conclusion
I hope you now have an idea of how to add a validation rule on a checkbox field in Salesforce. In this example, we saw how a checkbox can be used to make another field required only when it is selected.
This means that if the user checks the checkbox but leaves the related field blank, Salesforce will not allow the record to be saved.
You may like to read:
- Query Validation Rule in Salesforce
- Salesforce Checkbox Formula Field
- Salesforce Checkbox Default Value
- Bypass Validation Rules Using Salesforce Flow
- Before Insert Validation in Salesforce Trigger [With Examples]
The post Salesforce Checkbox Validation Rule with Examples appeared first on SalesForce FAQs.
September 16, 2025 at 06:56PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Shubham
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment