---
schema_version: "1"
id: 50b52a1ece0ba66b3825cc38489d9d14b52ce16eb9fe197ee14c703729dbf99c
title: OpportunityHistory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_opportunityhistory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunityhistory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ebf66acd8fdc755e9be49f1d96a83b2ccea92ebf9a255714807aa3602124b0db
description: Represents the stage history of an opportunity.
---
# OpportunityHistory

Represents the stage history of an opportunity.

## Supported Calls

describeSObjects(), getDeleted(), getUpdated(), query(), retrieve()

## Fields

| Field | Details |
| --- | --- |
| Amount | 
Type

currency

Properties

Filter, Nillable, Sort

Description

Estimated total sale amount.



 |
| CloseDate | 

Type

date

Properties

Filter, Group, Nillable, Sort

Description

Date when the opportunity is expected to close.



 |
| ExpectedRevenue | 

Type

currency

Properties

Filter, Nillable, Sort

Description

Calculated revenue based on the Amount and Probability fields.



 |
| ForecastCategory | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

Category that determines the column in which an opportunity is totaled in a forecast. Label is **To ForecastCategory**.

- BestCase
- Closed
- Forecast
- MostLikely
- Omitted
- Pipeline





 |
| IsDeleted | 

Type

boolean

Properties

Defaulted on create, Filter

Description

Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is **Deleted**.



 |
| OpportunityId | 

Type

reference

Properties

Filter, Group, Sort

Description

ID of the associated Opportunity.

This is a relationship field.

Relationship Name

Opportunity

Relationship Type

Lookup

Refers To

Opportunity



 |
| PrevAmount | 

Type

currency

Properties

Filter, Nillable, Sort

Description

The value in the opportunity’s Amount field before the update of the opportunity. In OpportunityHistory records created before Winter ’21, the value is null.Available in API version 50.0 and later.



 |
| PrevCloseDate | 

Type

date

Properties

Filter, Group, Nillable, Sort

Description

The value in the opportunity’s Close Date field before the update of the opportunity. In OpportunityHistory records created before Winter ’21, the value is null.Available in API version 50.0 and later.



 |
| Probability | 

Type

percent

Properties

Filter, Nillable, Sort

Description

Percentage of estimated confidence in closing the opportunity.



 |
| StageName | 

Type

picklist

Properties

Filter, Group, Sort

Description

Name of the current stage of the opportunity (for example, Prospect or Proposal).



 |

## Usage

This object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity. To obtain information about how a particular opportunity is progressing, query the OpportunityHistory records associated with a given Opportunity. Please note that if an opportunity's Amount, Probability, Stage, or Close Date fields have not changed, nothing will be returned in the OpportunityHistory objects. In this case, query the OpportunityFieldHistory records associated with a given Opportunity to get more information about changes to the opportunity.

This object is read-only. The system generates a new record whenever a user or client application changes the value of any of the above fields; the then-current values of all of these major fields are saved in the newly-generated object.

This object respects field-level security on the parent object.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

The record is automatically deleted if its parent Opportunity is deleted.

#### See Also

- [Opportunity](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm "Represents an opportunity, which is a sale or pending deal.")