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
Michael De FeyterMichael De Feyter 

Reports on Approval Processes

Hi all,

I need to report on Approvals in SFDC and need to interface that same information to another system.

What is the best approach?

Setup: 1 Custom Object with standard Approval Processes on it.

Possible solutions:
Do I best duplicate the approval info ('Approved By' and 'Approval Date') on that custom object itself (new fields that I don't show in UI but only use in reports and for interfacing)
OR
can I create SFDC reports on that custom object combined with the approval process info that I need AND do the same with SOQL statements for the interfacing part.

Or is there another option I overlooked?

Any help is welcome.
Best Answer chosen by Michael De Feyter
Xavier MuñozXavier Muñoz
Hi Michael,

If you need info of the parent record of the approval, I think the standard report will not work.
There is an idea for that: https://success.salesforce.com/ideaView?id=08730000000l7SVAAY

Assuming that, I think you have two options. Filling additional fields in the records as u proposed, or creating the "report" using a visualforce page (not an optimal solution...).
If you only need one report without structural changes and the amount of data is not so big, maybe the visualforce is better, otherwise I think your first option is the best one.

Good Luck!

 

All Answers

Xavier MuñozXavier Muñoz
Hi Michael,

I think the first solution is not good. You could have multiple approval processess for the same record, so you would need a custom object to store the full list, and you would be creating a lot of unnecesary records/fields.

I think the best solution (if you can get all the information you need from that), would be to get the reports using standard reporting with report type on processInstance object, associated with Process Instance Node https://help.salesforce.com/HTViewHelpDoc?id=approval_history_reports_examples.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=approval_history_reports_examples.htm&language=en_US)

For the integration, I don't know the details, but you could export the report as csv for file integration, or access to the records via SOQL (e.g. for WSDL Callout).
Check and play with the standard approvals datamodel https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_process.htm

 
Michael De FeyterMichael De Feyter
Hi Xavier,

thanks for this info.
As for the standard reporting: I tried your suggestions but I can't get enough info on 1 report.
When I use Process Instance and Process Instance Node I can only get the record name of the approved/pending/rejected record (from a custom object).
I need a few other fields from that Custom Object as well but can't seem to get them in the report (I can't combine Process Instance with that Custom Object in a report type).

I tried Joined Reports but it doesn't really join all the info I need. It's more like 2 separate reports next to each other.
If I could really join this info into 1 report, that would do the trick.

The SOQL query will be less of a problem.

So I'm close but no sigar...

The way we have set up the approval processes on the custom object, 1 record can only trigger 1 approval process. Possibly with multiple approvers.
So I'm affraid I will have to go with solution #1 (extra custom fields that are updated upon Submiting and Approval).
Downside: storing redundant information and the risk of losing info because only the last change will be captured.


 
Xavier MuñozXavier Muñoz
Hi Michael,

If you need info of the parent record of the approval, I think the standard report will not work.
There is an idea for that: https://success.salesforce.com/ideaView?id=08730000000l7SVAAY

Assuming that, I think you have two options. Filling additional fields in the records as u proposed, or creating the "report" using a visualforce page (not an optimal solution...).
If you only need one report without structural changes and the amount of data is not so big, maybe the visualforce is better, otherwise I think your first option is the best one.

Good Luck!

 
This was selected as the best answer
Michael De FeyterMichael De Feyter
Hi Xavier,

We will go for the additional fields as the report might be subject of structural changes by non developers.

Thanks for the Idea. Seems other people also have encountered the same problem.
Hope this Idea gets picked up soon.

Thanks for the help!