ProcessInstance

Represents an instance of a single, end-to-end approval process. Use this and the node, step, and workitem process instance objects to create approval history reports.

For approval process instances that were completed before the Summer ‘14 rollout, all Process Instance fields are automatically populated, with one exception: CompletedDate is never populated for approval process instances that were completed before January 1, 2013. For approval process instances that were pending during the Summer ‘14 rollout, all ProcessInstance fields are automatically populated, with two exceptions: CompletedDate and LastActorId are populated only after the approval process instance is complete.

Exceptions apply to approval history data retrieved with this object and are available only via SOAP API. For each approval process instance that was pending when Summer ‘14 became available for your organization, some field values are never populated or are populated only after the rollout. Other fields are populated only after the approval process instance is next acted upon—such as when a user approves, rejects, or reassigns an approval request—after the Summer ‘14 rollout.

describeSObjects(), query(), retrieve()

  • Type: dateTime
  • Properties: Filter, Nillable, Sort
  • Description: The completion date and time of the approval process. The ElapsedTimeDay, ElapsedTimeHours, and ElapsedTimeMinutes field values are calculated using CompletedDate.
  • Type: double
  • Properties: Filter, Nillable, Sort
  • Description: The total elapsed time in days between when the approval process instance was started and now.
  • Type: double
  • Properties: Filter, Nillable, Sort
  • Description: The total elapsed time in hours between when the approval process instance was started and now.
  • Type: double
  • Properties: Filter, Nillable, Sort
  • Description: The total elapsed time in minutes between when the approval process instance was started and now.
  • Type: reference

  • Properties: Group, Filter, Nillable, Sort

  • Description:

    The last actor that approved, rejected, or recalled the process.

    This is a relationship field.

  • Relationship name: LastActor

  • Relationship type: relationship

  • Refers to: User

  • Type: reference

  • Properties: Group, Filter, Sort

  • Description:

    The ID of this approval process instance.

    This is a relationship field.

  • Relationship name: ProcessDefinition

  • Relationship type: relationship

  • Refers to: ProcessDefinition

  • Type: picklist
  • Properties: Filter, Group, Restricted picklist, Sort
  • Description: The status of this approval process instance.
  • Possible values:
    • Approved
    • Fault
    • Held
    • NoResponse
    • Pending
    • Reassigned
    • Rejected
    • Removed
    • Started
  • Type: reference

  • Properties: Filter, Group, Nillable, Sort

  • Description:

    The ID of the user who submitted the approval process.

    This is a relationship field.

  • Relationship name: SubmittedBy

  • Relationship type: relationship

  • Refers to: User

Use this object to query or retrieve an approval process.

The following SOQL query returns details for all the ProcessInstanceStep records related to individual ProcessInstance records. The nested query references Steps, which is the child relationshipName for ProcessInstanceStep in the ProcessInstance object.

The following SOQL query returns details for all the ProcessInstanceWorkItem records related to individual ProcessInstance records. The nested query references Workitems, which is the child relationshipName for ProcessInstanceWorkItem in the ProcessInstance object.

ProcessInstanceHistory can help provide a unified read-only view of the ProcessInstanceStep and ProcessInstanceWorkItem objects.

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version.