Exceptions apply to approval history data retrieved with this object and available only via the 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 approval process instance is next acted upon—such as when a user approves, rejects, or reassigns an approval request—after the Summer ’14 rollout.
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.
describeSObjects(), query(), retrieve()
Field | Details |
---|---|
CompletedDate |
|
ElapsedTimeInDays |
|
ElapsedTimeInHours |
|
ElapsedTimeInMinutes |
|
LastActorId |
|
ProcessDefinitionId |
|
Status |
|
TargetObjectId |
|
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.
SELECT Id, (SELECT Id, StepStatus, Comments FROM Steps) FROM ProcessInstance
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.
SELECT Id, (SELECT Id, ActorId, ProcessInstanceId FROM Workitems) FROM ProcessInstance
ProcessInstanceHistory can help provide a unified read-only view of the ProcessInstanceStep and ProcessInstanceWorkitem objects.