SOQL on Salesforce Approval Process

ProcessInstance

SELECT Id, (SELECT Id, ProcessInstanceId, StepStatus, Comments, CreatedDate FROM Steps ORDER BY CreatedDate DESC)TargetObjectId, Status FROM ProcessInstance WHERE TargetObjectId='5009E000007vqVS'

ProcessInstanceStep

SELECT ActorId, Comments, CreatedById, CreatedDate, ElapsedTimeInDays, ElapsedTimeInHours, ElapsedTimeInMinutes, Id, OriginalActorId, ProcessInstanceId, StepNodeId, StepStatus, SystemModstamp FROM ProcessInstanceStep where ProcessInstanceId='04g9E000000P7ysQAC'


ProcessInstance with Step Name

SELECT Id, Name, ProcessDefinitionId FROM ProcessNode WHERE ProcessDefinitionId IN (SELECT ProcessDefinitionID FROM ProcessInstance WHERE TargetObjectId = '5009E000007vqTH')


No comments:

Post a Comment