How get the Approval Process Id using Process Instance Step or Approval History in Salefsorce?

How get the Approval Process Id using Process Instance Step or Approval History in Salefsorce?

1. Get the ProcessInstanceId.

SELECT Id, ProcessInstanceId 
FROM ProcessInstanceStep 
WHERE Id = '<Id Of the Process Instance Step>’'

2. ProcessDefinitionId is the id of the Approval Process.

SELECT Id, TargetObjectId, ProcessDefinitionId 
FROM ProcessInstance 
WHERE Id = '<ProcessInstanceId>'

From the Approval History, open the Process Instance Step and get the Id.

Leave a Reply