function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Georgia2Georgia2 

Validation Rule to Make a Field Required When a Checkbox Value is "True"

Hello

I am trying to make the Contact Email address field required when one of two cusom check boxes are checked.

I have a two checkbox fields in the Contact Object, one called SO Contact and the other AR Contact.  If either or both of these checkboxes are checked, I want the Email Address to be required.

Any suggestions?

 

Thank you

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Try hacking up this one

 

 

AND(OR(Checkbox_1__c, Checkbox_2__c), (LEN(Email__c ) < 1))

 

 

 

All Answers

Steve :-/Steve :-/

Try hacking up this one

 

 

AND(OR(Checkbox_1__c, Checkbox_2__c), (LEN(Email__c ) < 1))

 

 

 

This was selected as the best answer
Georgia2Georgia2
Very good- Thanks!!
Georgia2Georgia2
I am not sure how I mark this one Solved.  Can you assist please?  Thanks
Steve :-/Steve :-/
No problem, that's why they pay me the BIG bucks!
Steve :-/Steve :-/
There should be a Green Button with a checkbox that you can click in the post that contains the accepted solution.
Message Edited by Stevemo on 09-30-2009 03:17 PM
nickfs92840nickfs92840

Hi Stevemo!

 

I think this one you can help me with.

 

I have a picklist value: Provider Match

 

and three check boxes: HB, WP, AP

 

When a user selects Provider Match, the three checkboxes should become available and the user should select from any of the three.

 

However, when the picklist value Provider Match is not selected, the check boxes should be greyed out.

 

Is this possible? If so, can you provide me a validation rule formula?

 

Thank you again!!! 

Steve :-/Steve :-/

Hi Nick, it might make sense to start creating new message threads for these questions.

Anyway, if you simply want to make the fields visible or hidden, then what you can do is create a seperate Page Layout that does not contain the Checkbox fields that you want to hide or show.  Then create a custom Record Type and assign the "Hide/Show fields" Page Layouts to the appropriate Record Type.  

 

Once you have them setup create a Workflow Rule with a Field Update.  The workflow rule will be something like:

 

Evaluation Criteria: Every time a record is created or edited
Rule Criteria: Picklist equals "Provider Match"

 Then create a Field Update like this:

 

 

Field to Update: Record Type
Field Data Type: Record Type
Field Value: Show Checkbox Page Layout

 If you want to actually prevent the checkboxes from being checked, then you're gonna need to add a validation formula on there that evaluates the Picklist and the Checkboxes and throws an error message, or an additional Workflow Rule and Field Update that Unchecks the Checkbox fields if the Picklist Field is changed to something other than "Provider Match". 

 

 


 

nickfs92840nickfs92840

Stevemo, I have four other choices from the picklist, should I set up using the same formula?

 

 

Steve :-/Steve :-/

Hi Nick, I'm not sure that I follow you.  Is there only 1 value in your Picklist field that you want to make the Checkbox fields visible?  or are there other Picklist values that you need to evaluate in order to show/hide the Checkboxes?

 

 

Message Edited by Stevemo on 10-26-2009 10:43 AM
Sales CollateralSales Collateral
Steve does it again!! Thank you!