ForecastingTypeSource maps a ForecastingSourceDefinition to a ForecastingType. It identifies which source definition participates in a forecast type and, where applicable, how that source connects to a parent source.
This is a separate metadata component with its own inherited fullName. It is not the forecast type or the source definition, and it does not control activation. Activation belongs to the linked ForecastingType.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The mapping component's own metadata name, inherited from Metadata. |
forecastingSourceDefinition |
Required. The ID of the linked ForecastingSourceDefinition. |
forecastingType |
Required. The ID of the linked ForecastingType. |
masterLabel |
Required. The label for this forecasting type source. |
parentSourceDefinition |
Identifies the parent ForecastingSourceDefinition when the forecast type is based on neither Opportunity nor a custom measure. |
relationField |
The field connecting the parent and child source objects. Documented values are OpportunityLineItem.OpportunityId, OpportunityLineItem.Product2Id, OpportunityLineItemSchedule.OpportunityLineItemId, and OpportunitySplit.OpportunityId. |
sourceGroup |
Required integer that groups forecasting source definitions. The example value 1 is not a documented default or required group number. |
Behavior and Constraints
Read the source relationship as a whole
For forecast types based on neither Opportunity nor a custom measure, parentSourceDefinition identifies the parent of the source definition linked through forecastingSourceDefinition. The forecasting source model uses these parent relationships:
- Opportunity Product is the parent of Opportunity.
- Opportunity Split is the parent of Opportunity.
- Line Item Schedule is the parent of Opportunity Product.
Interpret forecastingSourceDefinition, parentSourceDefinition, and relationField together. Do not infer the forecasting model's parent direction solely from which object contains the lookup field. For example, the documented relationship field OpportunityLineItemSchedule.OpportunityLineItemId must be read alongside the selected source definitions.
Keep component identity separate from linked IDs
The required forecastingSourceDefinition and forecastingType elements are documented as IDs of the linked components. They are not the fullName of the ForecastingTypeSource mapping itself. Do not reinterpret an ID as a developer name merely because it is stored in a string element.
Activation belongs to the forecast type
A newly created ForecastingType starts inactive. When the forecast type already exists, deployment updates its active flag. A successful ForecastingTypeSource deployment therefore does not establish that its linked forecast type is active.
Deployment and Retrieval
ForecastingTypeSource components use the .forecastingTypeSource file suffix and are stored in the ForecastingTypeSources folder. The type supports the wildcard member * in package.xml, the manifest that selects metadata for deployment or retrieval.
Deploy the related metadata in this sequence:
ForecastingSettingsForecastingTypeForecastingSourceDefinitionForecastingTypeSource
When all four are specified in the same package, Salesforce follows this sequence automatically. When deploying them separately, preserve that order.
Creating and activating a new forecast type requires deploying the package twice: the first deployment creates the ForecastingType inactive, and the second updates its active flag. This is the lifecycle of the linked forecast type, not a separate activation step on ForecastingTypeSource.
Relationships
The mapping connects a forecast type to its source definition and can also describe a parent-source connection. A ForecastingFilter can reference the mapping, so impact analysis can extend from a source definition through ForecastingTypeSource to filters that use it.
References
-
ForecastingSourceDefinition:forecastingSourceDefinition,parentSourceDefinition. -
ForecastingType:forecastingType. -
CustomField:relationField.
Referenced By
-
ForecastingFilter:forecastingTypeSource.
Common Questions
Why is my forecast type inactive after deploying ForecastingTypeSource?
The mapping does not control activation. A new ForecastingType starts inactive, and creating and activating it requires two package deployments. Deployment of an existing forecast type updates its active flag.
What deployment order does ForecastingTypeSource require?
Deploy ForecastingSettings, then ForecastingType, then ForecastingSourceDefinition, and finally ForecastingTypeSource. Salesforce applies this sequence automatically when all are specified in the same package.
Can I retrieve ForecastingTypeSource with a wildcard?
Yes. Use ForecastingTypeSource as the type name and * as the member in package.xml. Component files use the .forecastingTypeSource suffix in the ForecastingTypeSources folder.
How do I determine the parent source in ForecastingTypeSource?
Read forecastingSourceDefinition, parentSourceDefinition, and relationField together. The documented forecasting model makes Opportunity Product and Opportunity Split parents of Opportunity, and Line Item Schedule the parent of Opportunity Product. The object containing a lookup field alone does not establish that direction.