RecordAggregationDefinition

Represents a data aggregation from one object to another object to which it is connected by other objects in the data model.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

RecordAggregationDefinition components have the suffix .RecordAggregationDefinition and are stored in the RecordAggregationDefinitions folder.

Version

RecordAggregationDefinition components are available in API version 59.0 and later.

Special Access Rules

To access the RecordAggregationDefinition metadata type, you must have the Record Aggregation permission set license and the Record Aggregation Access permission.

Fields

Field Name Description
aggregateFromObject
Field Type
string
Description

Required.

API name of the object from which data is aggregated.

aggregateToObject
Field Type
string
Description

Required.

API name of the object to which data is aggregated.

aggregationType
Field Type
RecordAggregationDefinitionAggregationType (enumeration of type string)
Description

Required.

Type of the data aggregation.

Valid value is:

  • Record
batchProcessingDefinition
Field Type
string
Description
Data Processing Engine definition that aggregates data from one record to another.
description
Field Type
string
Description
Description for this record aggregation definition.
displayName
Field Type
string
Description

Required.

Name of the record aggregation definition that's displayed in the record page.

recordAggregationObject
Field Type
RecordAggregationObject[]
Description
List of record aggregation objects in the record aggregation join sequence.
status
Field Type
RecordAggregationDefinitionStatus (enumeration of type string)
Description

Required.

Status of this record aggregation definition.

Values are:

  • Active
  • Draft
  • Inactive

RecordAggregationObject

Represents an object in the record aggregation join sequence.

Field Name Description
associatedObject
Field Type
string
Description
Required.
API name of the object associated with this record aggregation object.
developerName
Field Type
string
Description
Developer name of the record aggregation object. May contain only underscores and alphanumeric characters and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
filterLogic
Field Type
string
Description
Logical sequence in which the record aggregation object filters associated with this record aggregation object are applied to the associated object's records. If you define two or more record aggregation object filters, but don’t specify the sequence in which to apply the filters, the filters are applied by using a logical AND expression.
Available in API version 60.0 and later.
masterLabel
Field Type
string
Description

Required.

A user-friendly name for RecordAggregationDefinition, which is defined when the RecordAggregationDefinition is created.

recordAggregationJoinCondition
Field Type
RecordAggregationJoinCondition[]
Description
List of join conditions that apply to this record aggregation object.
recordAggregationObjectFilter
Field Type
RecordAggregationObjectFilter[]
Description
List of filters that are applied to the records of this record aggregation object.
Available in API version 60.0 and later.

RecordAggregationJoinCondition

Represents a condition in a join between two record aggregation objects.

Field Name Description
joinField
Field Type
string
Description
Required.
API name of the field on the record aggregation object's associated object that is used in the join condition.
navigationSequenceNumber
Field Type
int
Description
Required.
Sequence number corresponding to this join in the join sequence from the object to which the data is aggregated to the object that contains the data being aggregated.
relatedJoinField
Field Type
string
Description
Required.
API name of the field on the related record aggregation object's associated object that is used in the join condition.
relatedRecordAggregationObject
Field Type
string
Description
Required.
Second record aggregation object in the join condition.
type
Field Type
RecordAggregationJoinConditionType (enumeration of type string)
Description
Required.
Type of this record aggregation join in the join path from the object to which the data is aggregated to the object that contains the data being aggregated.
Valid values are:
  • AggregateFrom
  • AggregateTo
  • Intermediate

RecordAggregationObjectFilter

Represents a filter that is applied to the records of an object in the record aggregation join sequence. Available in API version 60.0 and later.

Field Name Description
associatedObjectField
Field Type
string
Description

Required.

API name of the associated object's field whose value is used to filter the object's records. The associated object is specified in the record aggregation object.

operator
Field Type
RecordAggregationObjectFilterOperator (enumeration of type string)
Description

Required.

Operator used in the filter expression.

Values are:

  • Contains
  • Equals
  • GreaterThan
  • GreaterThanOrEquals
  • In
  • LessThan
  • LessThanOrEquals
  • NotEquals
  • NotIn
sequenceNumber
Field Type
int
Description

Required.

Sequence number of this record aggregation object filter.

value
Field Type
string
Description

Required.

Reference value with which the designated field's values are compared when the filter is applied on the associated object's records.

Declarative Metadata Sample Definition

The following is an example of a RecordAggregationDefinition component.

<?xml version="1.0" encoding="UTF-8"?>
<RecordAggregationDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <aggregateToObject>PartyRelationshipGroup</aggregateToObject>
    <aggregateFromObject>PartyIncome</aggregateFromObject>
    <status>Active</status>
    <aggregationType>Record</aggregationType>
    <description>Aggregate head of household's income to household</description>
    <displayName>Party Income to Party Relationship Group</displayName>
    <recordAggregationObject>
        <associatedObject>PartyRelationshipGroup</associatedObject>
        <masterLabel>Party Relationship Group Object</masterLabel>
        <developerName>PartyRelationshipGroupObject</developerName>
        <recordAggregationJoinCondition>
            <joinField>Account</joinField>
            <navigationSequenceNumber>1</navigationSequenceNumber>
            <relatedJoinField>Account</relatedJoinField>
            <relatedRecordAggregationObject>AccountContactrelationObject</relatedRecordAggregationObject>
            <type>Intermediate</type>
        </recordAggregationJoinCondition>
        <recordAggregationObjectFilter>
          <associatedObjectField>Type</associatedObjectField>
          <operator>Equals</operator>
          <value>Household</value>
          <sequenceNumber>1</sequenceNumber>
        </recordAggregationObjectFilter>
    </recordAggregationObject>
    <recordAggregationObject>
        <associatedObject>AccountContactRelation</associatedObject>
        <masterLabel>Account Contact Relation Object</masterLabel>
        <developerName>AccountContactRelationObject</developerName>
        <recordAggregationJoinCondition>
            <joinField>Contact</joinField>
            <navigationSequenceNumber>2</navigationSequenceNumber>
            <relatedJoinField>Party</relatedJoinField>
            <relatedRecordAggregationObject>PartyIncomeObject</relatedRecordAggregationObject>
            <type>Intermediate</type>
        </recordAggregationJoinCondition>
        <recordAggregationObjectFilter>
          <associatedObjectField>IsPrimaryMember</associatedObjectField>
          <operator>Equals</operator>
          <value>true</value>
          <sequenceNumber>1</sequenceNumber>
        </recordAggregationObjectFilter>
    </recordAggregationObject>
    <recordAggregationObject>
        <associatedObject>PartyIncome</associatedObject>
        <masterLabel>Party Income Object</masterLabel>
        <developerName>PartyIncomeObject</developerName>
        <filterLogic>1 AND 2</filterLogic>
        <recordAggregationObjectFilter>
          <associatedObjectField>IncomeFrequency</associatedObjectField>
          <operator>Equals</operator>
          <value>Monthly</value>
          <sequenceNumber>1</sequenceNumber>
        </recordAggregationObjectFilter>
        <recordAggregationObjectFilter>
          <associatedObjectField>IncomeStatus</associatedObjectField>
          <operator>Equals</operator>
          <value>Active</value>
          <sequenceNumber>2</sequenceNumber>
        </recordAggregationObjectFilter>
    </recordAggregationObject>
</RecordAggregationDefinition>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>RecordAggregationDefinition</name>
    </types>
    <version>60.0</version>
</Package>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.