function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lukesh KarmoreLukesh Karmore 

How to query Approval Process Name (Unique Name ) which we add in step 1

How to query Approval Process Name.
SELECT Id,TargetObjectid, Status,a FROM ProcessInstance   
In below image I need to query this label Approval Request Submitted ,is there any way .
User-added image
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Lukesh,

We have an object called Process Definition where it will store all the details about the apporval process. You need to take the id from that Process Definition Object related to this and Query the ProcessInstance based on that Id.

Sample one:
 
SELECT Id, Name FROM ProcessDefinition where Name='Sample process'
The processDefinitionid in the below query is the id which we got from above.
SELECT ProcessDefinitionId, Id, TargetObjectId, Status FROM ProcessInstance where processDefinitionid='04a5j000000wrUEAAY'

If this solution helps, Please mark it as best answer.

Thanks,
 
John Jolly 9John Jolly 9
To use approval processes on Salesforce Knowledge articles with the Metadata API, the article type must be deployed. ... Unique name of the approval step. https://apkpure7.com/