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
intgintg 

Approval Data reporting?

Hello,

 

I need to add following fields from SF to Reports. These fields do not need to be added to the page layout.

 

1. Current Step Owner: Name of person (or people) that the approval process is currently pending with


2. Current Step Name: Name of Step that the approval process is currently pending with


3. Days in current step: Calculation of Time elapsed since an approval entered into the current approver’s bucket for ‘action’ and today’s date (date of generating the report)

 

All three of these fields require reporting off of the approval process

In short I want to know for each type of approval process for a custom object, which step of the approval it is in, who the approver is, and how long it has been in that step.

 

I see that, there is ProcessInstance and ProcessInstanceStep objects which stores this data, can someone provide SOQL queries sample on how to do this or any other way of reporting?

EnthEnth

You can't report on these objects using salesfore reports if that's what you mean, but you could make your approval process update some fields on your object to cache the same data and report on them instead. In terms of elapsed time you'll need a formula field that calculates the difference between today and the approval step time you cache.