FieldHistoryArchive

Represents field history values for all objects that retain field history. FieldHistoryArchive is a big object, available only to users with the “Retain Field History” permission.

Each instance of the FieldHistoryArchive object represents a single change in the value of a field. FieldHistoryArchive stores history for both standard and custom fields.

The Field field returns the name of the field unless the parent field or object is deleted, in which case it returns the field ID. You can use the ID to retrieve the old field and object name from the FieldNameAfterArchival and ParentNameAfterArchival fields, respectively.

Introduced in API version 29.0.

describeSObjects(), query()

  • Type: string
  • Properties: Group, Nillable
  • Description: The name of the field at the time the data was archived. If the field name changed, the name is sometimes not the same for all records related to a single field.
  • Type: string
  • Properties: Group, Nillable
  • Description: The name of the parent object at the time the data was archived. If the object name changed, the name is sometimes not the same for all records related to a single field.
  • Type: string
  • Properties: Group, Nillable
  • Description: The type of the field at the time the data was archived. If the field type changed, the type is sometimes not the same for all records related to a single field.
  • Type: datetime
  • Properties: Nillable
  • Description: The date and time at which the data was archived.
  • Type: picklist
  • Properties: Group, Restricted picklist
  • Description: The name of the field that was changed. If the field is deleted from the parent object, the Field field contains the field ID instead.
  • Type: picklist
  • Properties: Filter, Group, Nillable, Restricted picklist, Sort
  • Description: The name of the object that contains the field history.
  • Possible values:
    • Account — Account
    • Article — Article
    • Asset — Asset
    • AuthorizationFormConsent — AuthorizationFormConsent — Available in version 58.0 and later.
    • Case — Case
    • CommSubscriptionConsent — CommSubscriptionConsent — Available in version 58.0 and later.
    • Contact — Contact
    • ContactPointConsent — ContactPointConsent — Available in version 58.0 and later.
    • ContactPointTypeConsent — ContactPointTypeConsent — Available in version 58.0 and later.
    • Contract — Contract
    • ContractLineItem — ContractLineItem
    • Crisis — Crisis
    • Employee — Employee
    • EmployeeCrisisAssessment — EmployeeCrisisAssessment
    • Entitlement — Entitlement
    • Individual — Individual
    • InternalOrganizationUnit — InternalOrganizationUnit
    • Knowledge — Knowledge
    • Lead — Lead
    • Opportunity — Opportunity
    • Order — Order
    • OrderItem — OrderItem
    • PartyConsent — PartyConsent — Available in version 58.0 and later.
    • Pricebook2 — Pricebook2
    • PricebookEntry — PricebookEntry
    • Product2 — Product2
    • ServiceAppointment — ServiceAppointment
    • ServiceContract — ServiceContract
    • Solution — Solution
    • WorkOrder — WorkOrder
    • WorkOrderLineItem — WorkOrderLineItem
  • Type: reference
  • Properties: Filter, Group, Sort
  • Introduced: API version 42.0
  • Description: The ID of the relevant history object (for example, AccountHistory). This field is available in versions 42.0 and later.
  • Type: anytype
  • Properties: Nillable
  • Description: The new value of the modified field.
  • Type: anytype
  • Properties: Nillable
  • Description: The previous value of the modified field.
  • Type: reference
  • Properties: Filter, Group, Sort
  • Description: The ID of the object that contains the field (the parent object).

When sorting fields, order them as follows:

  1. FieldHistoryType ASC
  2. ParentID ASC
  3. CreatedDate DESC