Formulas are robust tools that enable users to perform calculations and other operations on their organization’s data. With formulas, users can embed hyperlinks, perform arithmetic with existing fields, or use conditional logic to display an amount.
Checkbox Type in Formulas
A Checkbox Formula is a logical statement that’s either true or false. For example: If a user wants to know if an account has at least 500 employees on it, he or she can make use of 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, a Large Account is not checked.
Formula Data types
- Checkbox: Calculate a boolean value.
- Currency: Calculate a dollar or other currency amount and automatically format the field as a currency amount.
- Date: Calculate a date, for example, by adding or subtracting days to other dates.
- Date/Time: Calculate a date/time, for example, by adding a number of hours or days to another date/time.
- Number: Calculate a numeric value.
- Percent: Calculate a percent and automatically add the percent sign to the number.
- Text: Create a text string, for example, by concatenating other text fields.
Features of Salesforce Formula fields
- Perform calculations between multiple number fields.
- Display data on a child object from the parent object.
- Link and manipulate fields.
- Calculate a certain date between two date fields.
- Display different images if a certain criterion is true.
Uses of Formulas
- Approval Processes – Define the criteria that a record must meet to enter the approval process.
- Approval Steps – Define the criteria a record must meet to enter the approval step.
- Assignment Rules for Leads and Cases – Define the criteria the lead or case must meet for it to be assigned.
- Auto-Response Rules for Leads and Cases – Define the criteria a lead or case must meet to trigger an auto-response rule.
- Case Escalation Rules – Specify the criteria a case must meet for it to be escalated.
- Custom Buttons and Links – Define the content for custom links and buttons.
- Workflow Rules Define the criteria a record must meet to trigger a workflow rule.
- Visualforce Pages – Define the content for Visualforce pages.
The users can utilize these operators and functions for building formulas. All functions are available to include them in a formula like formula fields, validation rules, approval processes, and workflow rules.
- Add (+) – It calculates the sum of two values.
- Subtract(-) – It calculates the difference of two values.
- Multiply(*) – It multiplies its values.
- Divide(/) – It divides its values.
- Open Parenthesis and Close Parenthesis () – It specifies that the expressions within the open parenthesis and close parenthesis are evaluated first.
- Concatenate(&) – It joins two or more strings.
- Equal = and == – It evaluates if two values are equivalent.
- Not Equal <> and != – It evaluates if two values are not equivalent.
- Less than< – It evaluates if a value is less than the value that follows this symbol.
- Greater than> – It evaluates if a value is greater than the value that follows this symbol.
- Less than or equal <= – It evaluates if a value is less than or equal to the value that follows this symbol.
- Greater than equal>= – It evaluates if a value is greater than or equal to the value that follows this symbol.
- AND && – It evaluates if two values or expressions are both true. Use this operator as an alternative to the logical function AND.
- OR || – It evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative to the logical function OR.
Formulas are an amazing way to calculate something, create validation rules, combine data from multiple fields, to check a condition,define workflow criteria, to display information from one record on a related record. Formula fields are based on other fields values that are shown only in detailed view of an object and can not be viewed in editable view of an object.