Roll-Up Summary Fields
Roll-up summary fields calculate values from a set of related records, such as those in a related list. You can create roll-up summary fields that automatically display a value on a master record based on the values of records in a detail record. These detail records must be directly related to the master through a master-detail relationship.
You can perform different types of calculations with roll-up summary fields. You can count the number of detail records related to a master record, or calculate the sum, minimum value, or maximum value of a field in the detail records.
Since roll-up summary fields are based on master-detail relationships, it’s useful to review object relationships before creating a roll-up summary field.
You define a roll-up summary field on the object that is on the master side of a master-detail relationship. For example, you can create a roll-up summary field on the Account object, summarizing related opportunities:
You can perform different types of calculations with roll-up summary fields. You can count the number of detail records related to a master record, or calculate the sum, minimum value, or maximum value of a field in the detail records.
Since roll-up summary fields are based on master-detail relationships, it’s useful to review object relationships before creating a roll-up summary field.
Master-Detail Relationships
Master-detail relationships closely link objects together so that the master record controls specific behaviours of the detail and sub-detail record.You define a roll-up summary field on the object that is on the master side of a master-detail relationship. For example, you can create a roll-up summary field on the Account object, summarizing related opportunities:
Creating the Summary Field
- Click Setup | Customize | Your Object | Fields.
- Click New.
- Choose the Roll-Up Summary field type, and click Next.
- Enter a field label and any other attributes. Click Next.
- Select the object on the detail side of a master-detail relationship. This object contains the records you want to summarize.
- Select the type of summary:
- Enter your filter criteria if you want a selected group of records in your summary calculation. If your organization uses multiple languages, enter filter values in your organization's default language.
- Click Next.
- Set the field-level security to determine whether the field should be visible for specific profiles, and click Next.
- Choose the page layouts that should display the field. The field is added as the last field in the first two-column section on the page layout. For user custom fields, the field is automatically added to the bottom of the user detail page.
- Click Save to finish or Save & New to create more custom fields.
Comments