Newer Version Available
FieldChangeSnapshot
Use this virtual object to learn which opportunities' close dates changed
during the specified time period. This object is available in API version 52.0 and
later.
Supported Calls
describeSObjects(), query()
Special Access Rules
To use FieldChangeSnapshot, 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 |
|---|---|
| CurrentValueDateOnly |
|
| FieldName |
|
| ParentId |
|
| ValidFrom |
|
| ValidTo |
|
Usage
Use FieldChangeSnapshot to learn about the first change made to the specified opportunity during the specified time period. Subsequent changes are not returned.
Example
Suppose that last week you changed an opportunity's close date to June 1, 2021.
Assuming the opportunity had the ID '006R0000XXXXXXXXXX', the following query would return
the CurrentValueDateOnly of June 1,
2021:
1Select CurrentValueDateOnly from FieldChangeSnapshot where ParentID = '006R0000XXXXXXXXXX' and FieldName = 'CloseDate' and ValidTo = LAST_WEEK AND ValidFrom = LAST_WEEK and CurrentValueDateOnly < 2021-07-01