Salesforce Approval Process Objects ProcessInstanceStep & ProcessInstanceWorkitem


Example

Both objects ProcessInstanceStep & ProcessInstanceWorkItem are instances of process steps that are created for particular ProcessInstance. ProcessInstanceStep represents a step instance in an approval process (ProcessInstance) on which users has already acted and ProcessInstanceWorkItem represents a step instance in an approval process(ProcessInstance) on which is pending and users has to perform some action next on it. We can describe, query and retrieve the approval processes steps and workItems.

~ Query ~

SELECT CreatedById,CreatedDate,ElapsedTimeInDays,ElapsedTimeInHours,
ElapsedTimeInMinutes,Id,IsDeleted,OriginalActorId,ProcessInstanceId,
ActorId,SystemModstamp FROM ProcessInstanceWorkitem 

SELECT ActorId,Comments,CreatedById,CreatedDate,ElapsedTimeInDays,Id, 
ElapsedTimeInHours,ElapsedTimeInMinutes,OriginalActorId,ProcessInstanceId
,StepNodeId,StepStatus,SystemModstamp FROM ProcessInstanceStep