Newer Version Available

This content describes an older version of this product. View Latest

ForecastingSourceDefinition

Represents the object, measure, date type, and hierarchy that a forecast uses to project sales.

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

ForecastingSourceDefinition components have the suffix .forecastingSourceDefinition and are stored in the forecastingSourceDefinitions folder.

Version

ForecastingSourceDefinition components are available in API version 52.0 and later.

Fields

Field Name Field Type Description
categoryField string Name of the forecast category that is associated with the forecast type. Possible values are:
  • Opportunity.ForecastCategoryName
dateField string Field that is used for the forecast type’s date type. For example, the CloseDate field on Opportunity is used for opportunity close date-based forecast types. Possible values are:
  • Opportunity.CloseDate
  • OpportunityLineItem.ServiceDate
  • OpportunityLineItemSchedule.ScheduleDate
familyField string Use this field to group forecasts by product family. Possible values are:
  • Product2.Family
masterLabel string Required. Controlling label for this forecasting source definition.
measureField string Field that is used for the forecast type’s measure. For example, the Amount field on Opportunity is associated with revenue-based forecast types. Possible values are*:
  • Opportunity.Amount
  • Opportunity.Custom
  • Opportunity.TotalOpportunityQuantity
  • OpportunityLineItem.Custom
  • OpportunityLineItem.Quantity
  • OpportunityLineItem.TotalPrice
  • OpportunityLineItemSchedule.Custom
  • OpportunityLineItemSchedule.Quantity
  • OpportunityLineItemSchedule.Revenue
  • OpportunitySplit.Custom
  • OpportunitySplit.SplitAmount
*Where Custom represents the name of the custom field that a forecast type’s measure is based on. Example: Use Megawatts__c to forecast energy consumption.
sourceObject string Required. Object associated with this forecasting source definition. Possible values are:
  • Opportunity
  • OpportunityLineItem
  • OpportunityLineItemSchedule
  • OpportunitySplit
  • Product2
territory2Field string For a territory-based forecast type, indicates the field that is used for territory information. Possible values are:
  • Opportunity.Territory2Id

For user role-based forecast types, this value is null.

userField string Specifies who owns the forecast. Possible values are:
  • Opportunity.OwnerId
  • OpportunitySplit.SplitOwnerId

Declarative Metadata Sample Definition

The following is an example of a ForecastingSourceDefinition component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ForecastingSourceDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3    <masterLabel>TestFsd</masterLabel>
4    <sourceObject>Opportunity</sourceObject>
5    <measureField>Opportunity.Amount</measureField>
6    <dateField>Opportunity.CloseDate</dateField>
7    <userField>Opportunity.OwnerId</userField>
8    <categoryField>Opportunity.ForecastCategoryName</categoryField>
9</ForecastingSourceDefinition>

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

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>ForecastingSourceDefinition</name>
6    </types>
7    <version>52.0</version>
8</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.

Usage

  • Forecast types that were available before API version 52.0 can be activated, deactivated, and deleted but not created. To enable an existing forecast type, update the active flag.
  • Forecast types that are available only in API version 52.0 and later can be created, activated, deactivated, and deleted. If the forecast type doesn’t exist, it is created in the inactive state. If the forecast type exists, the active flag is updated. Deploy the zip file twice to create and activate the forecast type.
  • Deploy Metadata API types in the following sequence: ForecastingSettings, ForecastingType, ForecastingSourceDefinition, and then ForecastingTypeSource. If all are specified in the package file, the sequence is followed automatically.