Formula fields in Salesforce :  Formulas are those which are used to calculate something, combine data from multiple fields, to check for a condition, to show information from one record on a related record.These formulas will be simple or complex with layers of nested logic s. Formula fields is based on other fields values and it is shown only in detailed view of an object and can not be viewed in editable view of an object.

Where we use formulas  fields in Salesforce ?

  •  Business logic.
  •  formula field.
  • Default values for fields.
  • Workflow rules .
  • Validation rules
  • Reporting.
  • Buttons and Links.

Formulas in salesforce can be made up of two Parts .

  • Formula Syntax : Which we write n the formula editor.
  • Database query .

Formula syntax allows 3,900 maximum number of characters and the size of the formula when saved will be 4,000 bytes.Depending up on the Formula syntax and query the complexity increases.

Follow below limitation when using formulas to reduce complexity.

  1. Minimize the number of references to other fields.
  2. Minimize the number of times formula functions are called.
  3. Rethink about your picklist.
  4. Choose another way about the problem
  5. If all above cases fails use Workflow field update.

Operators and Functions used for formulas.

  1. Math Operators.
  2. Logical Operators.
  3. Text Operators.
  4. Date and Time Functions.
  5. Informational Functions.
  6. Logical Functions.
  7. Math Functions.
  8. Text Functions.
  9. Summary functions.
  10. Advanced Functions.
  11. Encoding Functions.