AccountPlanObjMeasCalcDef defines how to calculate the current value of a sales account plan objective measure. It combines a source object, an aggregation method, a rollup field, and optional record filters. It defines the calculation; it does not store the measure's current value or goal.
Account plans must be enabled to access these components. A definition's status controls whether users can select it for an objective measure: only Active definitions are available for selection.
Key Elements
| Element | What the Element Controls |
|---|---|
developerName |
Required unique API name. Must begin with a letter, contain no more than 40 characters, and use only alphanumeric characters and underscores. It cannot end with an underscore or contain consecutive underscores. |
masterLabel |
Required internal display label. This label is not translated. |
status |
Required. Accepts Active, Draft, or Inactive. Only Active definitions are available for users to select. |
targetObject |
Required source object for the calculation. Accepts Campaign, Case, Contact, or Opportunity. |
rollupType |
Required aggregation method: Count, Max, Min, or Sum. Its Setup label is Calculation Type. |
targetField |
Field on the selected targetObject used to calculate the measure's current value. Its Setup label is Rollup Field. |
conditions.fieldName |
Required within each condition. Identifies a filter field on the selected targetObject. |
conditions.operation |
Required within each condition. Accepts Contains, Equals, GreaterOrEqual, GreaterThan, LessOrEqual, LessThan, NotContain, NotEqual, or StartsWith. |
conditions.value |
Required within each condition. Supplies the string value to match against the filter field. |
Behavior and Constraints
Read targetObject, targetField, rollupType, and conditions together. The object supplies the records, the conditions filter which records are included, and the aggregation method and rollup field determine the resulting current value. The rollup field alone does not describe the calculation.
For example, an Opportunity calculation can use Sum with targetField set to Amount and a condition on StageName. The stage filter is part of the calculation's business meaning, not just the selected amount field.
conditions is an optional collection of filters. Every entry requires fieldName, operation, and value. Each filter field must belong to the selected targetObject. Although operation is represented as a string, it accepts only the listed operator values.
The status rule governs selection availability. It does not establish the effect of changing a definition's status on measures that already use it.
description is visible when users select a calculation definition for an objective measure. Use it to explain the aggregation and filters. It does not change their behavior, and it is separate from the untranslated internal label in masterLabel.
Deployment and Retrieval
Components are stored in the accountPlanObjMeasCalcDefs folder with the suffix .accountPlanObjMeasCalcDef. In package.xml, use AccountPlanObjMeasCalcDef as the metadata type name. A definition named Opportunity_Revenue_Targets, for example, can be selected with that name in the manifest's members element.
The component extends Metadata and inherits its fullName field. It also requires developerName, which must satisfy the naming restrictions above, along with masterLabel, rollupType, status, and targetObject. Account plans must be enabled in the org to access the component.
Include filter fields when identifying dependencies, not just the rollup field. Both targetField and each nested conditions.fieldName connect to field metadata. The object and field references do not expand the supported source objects beyond Campaign, Case, Contact, and Opportunity.
Relationships
The calculation definition connects to the source object's metadata and to the fields used for aggregation and filtering. These reference categories describe the dependencies; they do not permit arbitrary source objects.
References
-
CustomObject:targetObject. -
CustomField:targetFieldandfieldNameinsideconditions.
Common Questions
Why can't users select my account plan calculation definition?
Only definitions with status set to Active are available for selection. Definitions in Draft or Inactive status are not selectable. Account plans must also be enabled to access these components.
Which objects can an AccountPlanObjMeasCalcDef calculate from?
targetObject accepts Campaign, Case, Contact, or Opportunity. The rollup field and filter fields must belong to the selected object.
Where is AccountPlanObjMeasCalcDef stored for deployment and retrieval?
Its files use the .accountPlanObjMeasCalcDef suffix in the accountPlanObjMeasCalcDefs folder. Use AccountPlanObjMeasCalcDef as the type name in package.xml.
Do filter fields count as metadata dependencies?
Yes. Both targetField and conditions.fieldName reference CustomField metadata. A dependency review that includes only the rollup field misses the fields used to filter records.