Newer Version Available
OpportunityOverride Lifecycle
OpportunityOverride records are created, updated, or deleted only under certain conditions, and only for relevant users.
Creating Opportunity Overrides
Forecast managers can override a forecast-related value (such as Amount, Quantity, Forecast Period, and ForecastCategory) by editing the Opportunity Forecasts related list on an opportunity owned by a subordinate user. Also, the opportunity owner can change Opportunity forecast-related values (such as ForecastCategory, StageName, Amount, and CloseDate) on an Opportunity that he or she owns. ForecastCategory has additional rules governing it; see Special Case: Forecast Category for more information.
When a user sets the first override for a particular Opportunity record, OpportunityOverride records are created and appropriate values are written for the opportunity owner and every forecast manager above the Opportunity owner in the forecast hierarchy. The values stored in each user's record depend on their location in the hierarchy—users below the user who made an override will have the original values. Other users will have the overrides, plus the Opportunity values for anything not overridden.
When subsequent override values are set, the new values are written to the OpportunityOverride records of the user who set the override and other forecast managers above in the forecast hierarchy, until an existing override value is reached.
Quantity can only be overridden in the Salesforce user interface if Quantity Forecasting is enabled on the Forecast Settings page, and Amount can only be overridden if Revenue Forecasting is enabled.
Updating Opportunity Values and Opportunity Override Values
Whenever an opportunity forecast-related value is updated on the Opportunity record itself, the corresponding records in the OpportunityOverride for the Opportunity owner and forecast managers above the owner in the forecast hierarchy are updated, until the first override value is encountered. The Opportunity owner cannot override anything except ForecastCategory, but he or she can edit the CloseDate and StageName on the Opportunity Forecast edit page, in addition to ForecastCategory. All three fields correspond to the Opportunity record, and the result is the same whether they make the changes on the Opportunity Forecast edit page or the Opportunity edit page.
Changes to the following Opportunity fields also affect records in the OpportunityOverride.
- CloseDate affects the forecast PeriodId if the new CloseDate falls into a different Forecast Period than the old CloseDate. In this case, the OpportunityOverride PeriodId is updated on the opportunity override record of the opportunity owner, and all forecast managers above the owner in the forecast hierarchy, until the first overriden PeriodId is encountered.
- CurrencyType IsoCode changes always cause an update to the opportunity owner's OpportunityOverride. No other object is updated unless Amount changes, which is often the case.
- If territory management is enabled, territory changes on the Opportunity affect OpportunityOverride records. An Opportunity owner's OpportunityOverrides are updated with the new territory, and OpportunityOverride records are inserted or updated for forecast managers above the Opportunity owner in the forecast hierarchy. OpportunityOverride records are also deleted for any forecast manager whose territory (stored on the override record) is no longer above the Opportunity owner in the new opportunity territory. That is, even if the Opportunity owner remains a subordinate of a forecast manager before and after the update, if they roll up into a different territory, that forecast manager loses the OpportunityOverrides for the old territory and new records are created for the new territory.
- When an Opportunity is set to Closed Won (the StageName value is Closed Won), the AmountInherited, QuantityInherited, and PeriodInherited fields in OpportunityOverride are set to true and the corresponding values are updated to match the Opportunity, if they are different. The OpportunityOverride ForecastCategoryInherited flag is also set to true and the Opportunity ForecastCategory is set to Closed, unless it has been overridden to Omitted. Omitted is the only valid ForecastCategory override for a Closed Won opportunity.
- When an Opportunity is set to Closed Lost, the Amount and PeriodInherited flags are set to true, and the corresponding values are updated to match the Opportunity, if they are different, and the ForecastCategoryInherited flag is set to true and the ForecastCategory is set to Omitted if the current value is anything other than Omitted.
Deleting Opportunity Overrides
OpportunityOverride records are not deleted unless one of the following triggering events occurs.
- An Opportunity is deleted.
- A change is made in the forecast hierarchy, such that a particular OpportunityOverride owner is no longer above the Opportunity owner or is no longer the forecast manager in the relevant role or territory.
- An Opportunity is transferred to a new owner or territory, individually or as part of an account transfer.
- The “Allow Forecasting” permission is removed from a user.
When an Opportunity is transferred to a new owner, an OpportunityOverride record for the new owner is added as needed, and OpportunityOverride records are deleted for all users that are not forecast managers above the new owner in the forecast hierarchy, possibly including the previous Opportunity owner. Also, OpportunityOverride records are updated or inserted as necessary for all forecast managers above the new owner in the forecast hierarchy. Restrictions on Opportunity owners are strictly enforced during a transfer. If the new owner was in the forecast hierarchy of the previous owner, and had made overrides that are no longer valid as the opportunity owner, such as an Amount override, then the corresponding inherited flag is set to true and the value is refreshed from the opportunity.
Special Case: Forecast Category
An additional rule applies to ForecastCategory values: If you set the ForecastCategory in a new opportunity that is not the default forecast category for the stage selected, or update an existing ForecastCategory on an opportunity, then OpportunityOverride records are created for relevant users as described above. Since only Opportunity owners can update the ForecastCategory on an opportunity record directly, this scenario is treated as a ForecastCategory override by the opportunity owner (the ForecastCategoryInherited flag on that user's OpportunityOverride record is false).