ForecastingFilterCondition defines one field comparison used to include or exclude data from opportunity forecasts. It works with a ForecastingFilter, whose FilterLogic combines the indexed conditions into the complete inclusion rule. A forecast type can contain at most three filter conditions.
A condition is not the complete forecast filter. Its sortOrder identifies it within the associated filter logic; it does not control execution order. The condition also has its own metadata identity through the inherited fullName, separate from the record IDs stored in its reference fields.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
Inherited from Metadata. Identifies the condition as a metadata component, independently of the IDs it references. |
fieldName |
Required. Names the Opportunity field to compare. It can reference a custom field. |
forecastingFilter |
Required. The ID of the associated ForecastingFilter, not its developer name. |
forecastingSourceDefinition |
When supplied, identifies a ForecastingSourceDefinition by ID, not by developer name. |
masterLabel |
Required. The label displayed in Setup, in the organization's default language locale. If no default language locale exists, the label is in en_US. |
operation |
Required. The comparison operator. The type-specific list is equals, greaterOrEqual, greaterThan, lessOrEqual, lessThan, and notEqual. The exposed enumeration is broader; see Documentation Inconsistencies. |
sortOrder |
Required integer. The numeric identifier used for this condition in the associated ForecastingFilter object's FilterLogic field. |
value |
The comparison value, stored as a string. Separate multiple values with commas. Its meaning depends on fieldName and operation. |
Behavior and Constraints
Interpret a condition together with its parent filter logic. For example, a sortOrder of 1 means that the condition is represented by that index in FilterLogic; it does not mean the comparison runs first. If you change the index, keep the filter logic that references it consistent.
The limit of three filter conditions applies to a forecast type. A single comparison does not show how the filter combines that condition with the others.
Currency thresholds have a creation-time context. In a multicurrency organization, a custom filter on a currency field uses the corporate currency that was in effect when the filter was created. Do not interpret the threshold solely from the current corporate currency. In a single-currency organization, the filter condition uses the absolute value.
There are no additional access requirements specific to ForecastingFilterCondition.
Deployment and Retrieval
Components use the .ForecastingFilterCondition suffix and are stored in the ForecastingFilterConditions folder. The type supports * in the members entry of a package.xml manifest, with ForecastingFilterCondition as the type name. See Deploying and Retrieving Metadata with the Zip File for manifest handling.
Keep the condition's component identity separate from its references: fullName identifies the condition, while forecastingFilter and forecastingSourceDefinition contain IDs. Do not treat those ID fields as developer-name references.
Changes to the Opportunity field named by fieldName can affect the meaning or validity of the condition. Likewise, changing sortOrder without accounting for the associated FilterLogic can change which comparison the logic refers to.
Relationships
The condition connects an Opportunity field comparison to a forecast filter and, optionally, a forecasting source definition. The filter relationship supplies the context needed to interpret the condition's numeric index.
References
-
CustomField:fieldName. -
ForecastingFilter:forecastingFilter, an ID reference. -
ForecastingSourceDefinition:forecastingSourceDefinition, an ID reference.
Documentation Inconsistencies
The type-specific documentation lists six operators: equals, greaterOrEqual, greaterThan, lessOrEqual, lessThan, and notEqual. The exposed enumeration also includes contains, excludes, includes, notContain, startsWith, and within. Enumeration membership alone does not establish that these additional operators are supported for forecast conditions.
The published component example also contains mismatched XML closing tags: both operation and sortOrder close with </masterLabel>. Those elements must have matching closing tags before the example can be used as valid XML.
Common Questions
How many filter conditions can a forecast type have?
A forecast type can contain at most three filter conditions. The associated ForecastingFilter object's FilterLogic combines their indexed comparisons.
Does sortOrder control which forecast condition runs first?
No. sortOrder is the condition's numeric identifier in FilterLogic, not an execution-order setting. Change the index together with the logic that references it.
Do forecastingFilter and forecastingSourceDefinition use developer names?
No. Both fields use IDs. forecastingFilter is required; forecastingSourceDefinition is optional. The condition itself is identified through its inherited fullName.
Which currency does a forecast filter threshold use?
For a custom currency-field filter in a multicurrency organization, it uses the corporate currency in effect when the filter was created. In a single-currency organization, it uses the absolute value.
Can I retrieve all ForecastingFilterCondition components with a wildcard?
Yes. The type supports * as the manifest member. Its files use the .ForecastingFilterCondition suffix in the ForecastingFilterConditions folder.