+ Start a Discussion
gengen 

Get stepname in ApprovalProcess

Hi,

 

How to get the stepname Of approval process in salesforce using SOQL or any other APIs.

 

 

Thanks.....

Suma.

 

 

gautam_singhgautam_singh

Hi,

 

I believe there is not a direct workaround for this. But I did this to get the Step Name of the Approval Process on which I was .

1)Create a Number field ApprovalStepName


2)Add field update in your approval process steps to update it.
 

3)In the final approval action set it to Blank again


In the Similar Patter we can Track the Step Number also . Try this , It will definately work.



Important :

Hit Kudos [Star Icon ] if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You
-

sandeep@Salesforcesandeep@Salesforce

In Approval process there is no option to name steps by default it is Step1 and Step2..etc.

 

and to know these names I think you can apply SOQL on processinstance

Darshee MehtaDarshee Mehta
you can use a query of this sort: [SELECT Id, Status, CreatedDate, CompletedDate, TargetObjectId, 
                                                (SELECT Id, StepStatus, Actor.Name, ElapsedTimeInDays, ElapsedTimeInMinutes, 
                                                CreatedDate, ProcessNodeId, ProcessNode.Name, Comments 
                                                FROM StepsAndWorkitems order by CreatedDate) from ProcessInstance 
                                                Where TargetObjectId =: orderId order by CreatedDate]

ProcessNode.Name here will give the step name.