Newer Version Available
RecentFieldChange
Use this virtual object to see how an opportunity has changed in the past
seven days. Learn the previous value of a field, who made the change, and when the change
was made.This object is available in API version 52.0 and later.
Supported Calls
describeSObjects(), query()
Special Access Rules
To use RecentFieldChange, set up historical trend
reporting for opportunities in your org. You must also have the Pipeline Inspection user
permission and the Pipeline Inspection setting enabled.
Fields
| Field | Details |
|---|---|
| ChangeDate |
|
| CurrencyIsoCode |
|
| FieldName |
|
| ParentId |
|
| PreviousCurrencyValue |
|
| PreviousDateOnlyValue |
|
| PreviousTextValue |
|
| ValueChangedById |
|
Usage
One recentFieldChange record is returned for each field that was changed in the past seven days. The supported fields are Amount, Close Date, Forecast Category, and Stage Name. Only the most recent previous value is returned.
Example
To see the most recent previous amount for an opportunity, use the following query.
Replace 006R0000XXXXXXXXXX with the ID of the
opportunity.
1select PreviousTextValue from RecentFieldChange where ParentId = '006R0000003JkHBIA0' and FieldName = 'StageName'If the sales rep didn't change the opportunity stage name in the past seven days, no values are returned. If the sales rep changed the opportunity amount several times in the past seven days, only the most recent previous value is returned.
Example
To see the most recent previous amount, close date, and stage name for an
opportunity, use the following query. Replace 006R0000XXXXXXXXXX with the ID of the
opportunity.
1select PreviousTextValue, PreviousCurrencyValue, PreviousDateOnlyValue from RecentFieldChange where ParentId = '006R0000XXXXXXXXXX' and FieldName IN ('StageName', 'Amount', 'CloseDate')If the opportunity amount, close date, and stage name didn’t change in the past seven days, no values are returned.