How to Use Checkbox Field Type in Formulas



Checkbox in Formulas

A checkbox formula is just a logical statement that’s either true or false. If you want to know right away if an account has at least 500 employees on it, for example, you can use a simple checkbox formula.

NumberOfEmployees >= 500

If an account has more than or equal to 500 employees, the checkbox Large Account is checked on that account’s page. Otherwise, Large Account is not checked.

To take full advantage of the checkbox formula data type, you need some basic logical tools.

If you want your users to look at a contact and know right away whether it’s okay to contact them via email or phone. If the contact in question has marked Do Not Call and Email Opt Out, we want to select another checkbox, Do Not Contact. Because we want this checkbox to be checked only if the contact selected Do Not Call and Email Opt Out, we use the AND() function.

Create a checkbox formula the same way that you would create any other formula field in Salesforce.

  1. From Setup, enter Contacts in the quick find box and select Contacts | Fields.
  2. Scroll to the Contact Custom Fields & Relationships Section and click New.
  3. Select Formula and click Next.
  4. In Field Label, enter Do Not Contact. Field Name populates automatically.
  5. Select Checkbox and click Next.
  6. Copy the following code snippet and paste it into the formula editor.

AND(DoNotCall, HasOptedOutOfEmail)

 

This Blog is very useful to learn about how to use checkbox type in formula field with And() function.