---
schema_version: "1"
id: a68552e3d8f00e906ebb3b48c1218b6aee98b648385006a0f6d466ab9d00472f
title: OrderHistory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_orderhistory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_orderhistory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 69ad71a719ce5f057d58daee89a67185fd694f0a2a8731c1d67b11e66d6f03f4
description: Represents historical information about changes that have been made to the standard fields of the associated order, or to any custom fields with history tracking enabled.
---
# OrderHistory

Represents historical information about changes that have been made to the standard fields of the associated order, or to any custom fields with history tracking enabled.

## Supported Calls

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

You can also enable delete() in API version 42.0 and later. See [Enable delete of Field History and Field History Archive](https://help.salesforce.com/articleView?id=000321814&type=1&mode=1&language=en_US "HTML (New Window)").

## Fields

| Field Name | Details |
| --- | --- |
| DataType | 
Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

Data type of the field that was changed.



 |
| Field | 

Type

picklist

Properties

Filter, Group, Restricted picklist, Sort

Description

Name of the order field that was modified, or a special value to indicate some other modification to the order.



 |
| NewValue | 

Type

anyType

Properties

Nillable, Sort

Description

New value of the modified order field. Maximum of 255 characters.



 |
| OldValue | 

Type

anyType

Properties

Nillable, Sort

Description

Previous value of the modified order field. Maximum of 255 characters.



 |
| OrderId | 

Type

reference

Properties

Filter, Group, Sort

Description

ID of the order associated with this record.

This is a relationship field.

Relationship Name

Order

Relationship Type

Lookup

Refers To

Order



 |

## Usage

Order history entries are automatically created each time an order is modified.

Two rows are added to this record when foreign key fields change. One row contains the foreign key object names that display in the online application. For example, Jane Doe is recorded as the name of a Contact. The other row contains the actual foreign key ID that is only returned to and visible from the API.

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

#### See Also

- [Order](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_order.htm "Represents an order associated with a contract or an account.")