Formulas
A formula is similar to an equation that is executed at run time. Depending on the context of the formula, it can make use of various data and operations to perform the calculation. A useful way to think about formulas is that they are similar to formulas on a spreadsheet. These formulas can make use of data and operations to calculate a new value of some type. Formulas can be used in the database as a custom field type, or to define evaluation criteria for data validation and workflow, to calculate data presented in reports, and as expression language in Visualforce.
Articles and Presentations
An Introduction to Formulas provides an overview of formulas, together with examples of how they are used on the platform.
Building Smarter Apps Using Formulas and Workflow: a great webinar showing how to use formulas to improve applications
Official Documentation
- Reference Documentation
- Formula Quick Reference Guide (PDF) - A compressed formula operator and function reference cheat sheet.
- Useful Formula Fields (PDF) - Over 100 examples of using formulas in a Force.com app, plus a comprehensive formula operator and function reference.
- Useful Validation Rules (PDF) - Over 70 examples of using validation rules in a Force.com app.
- Other Useful Documentation
- The Operators and Functions list from the online help is invaluable. Log in to your environment, select Help, and search for Operators and Functions.
- The Tips for Building Formulas page, also available on the online help, is very useful. Log in to your environment, select Help, and search for Tips for Building Formulas.
- Steps to Successful Validation Rules is a slightly old, but useful document on data validation.
- An Introduction to the Force.com Database provides a much more comprehensive introduction to the Force.com Database.
- An Introduction to Visualforce provides a lot more detail on Visualforce, which also uses the formula language.
Discussion Board
- The Formulas & Validation Rules discussion board on the CRM Community is a great place to discuss formulas.