Formulas allow you to make calculations based on the information in other fields and formulas. They can do this automatically upon user input and will update themselves when information in the formula changes.
Permissions are required to work on Custom Objects and Fields.
A formula field lets you take the data in other fields and use it to make calculations and present the results. Formula fields get updated automatically when the data in the fields that are used by the formula get updated. Formula fields are always Read Only (can not be edited by the user) because their value depends on what is in the other fields, and it changes when those values change.
Formula fields can be made from number, text, and date or date/time fields.
You can not mix different data types depending on what the formula is. For example, multiplying a text field by a number field, or dividing a date by a number.
You can mix some data types if the formula is appropriate. For example, adding a date field to a number field will add time onto the date.
You can type in some values if they are appropriate. For example, you can type in a number to add, subtract, etc. from a field, such as [Total] + 5, or [Quantity] * 1.5. You can add to date fields, such as [Created Date] + 1, which will add one day to the date in the Created Date field.
You can concatenate text by adding it, so if the First Name field was "John" and the Last Name field was "Smith", the formula [First Name] + [Last Name] would be displayed as "JohnSmith"
Formula fields are added onto custom objects. Start from Setup > Development > Objects. Click on the custom object that you want to work with, or create a new object. See: Create a Custom Object.
If working on an existing object, click the Fields and Relationships tab. If creating a new object, this tab will appear after saving the new object for the first time.
Click New to create a new field.
Select Formula and click the Next tab.
The Field Label appears on the page layout, and this is the name the user sees for the field. It should be short and descriptive.
The Field Name is used by the application, and will show up for field mappings, merge templates, etc. It can be the same as the field label if you want, and it makes it a little easier to work with the object as well.
The Description is for reference purposes, describing what the field is for and how it is used.
Create a Formula by selecting a field from the first drop down list. The fields come from the object. This appears in the Expression text area.
Select the operation from the second drop down list: addition, subtraction, grouping by parenthesis, etc. You can type in appropriate values as well.
Keep selecting fields and operators until the formula is complete. You can type in some values, such as numbers, into a formula expression if they are appropriate. For example ( [Quantity] + 1) * [Price]
Click the Next tab.
Set the user profile permissions on the field.
Select the page layout or layouts that the field will appear on.
Click the Save button to save and create the field.
Custom Fields and Formulas Overview
Custom Object - Fields and Relationships
Did you find what you were looking for? Yes No
Did this help you? Very Helpful 5 4 3 2 1 Not Helpful
How can we improve this topic?
Send Feedback: