You need to sign in to do that
Don't have an account?
@DEVS
Scheduling reports using Apex
I have a requirement to send weekly reports in email to indivudual memebrs as per their visibility.
I've an idea to write an apex class which I can schedule it using Scheduled Apex.
Inside the class I want to use ReportManager class to run a specific report.
My question here is - How can I run it as a specific user ?
I've an idea to write an apex class which I can schedule it using Scheduled Apex.
Inside the class I want to use ReportManager class to run a specific report.
My question here is - How can I run it as a specific user ?
But the question is - How can we do that all users ? Without any manual interuption.
Then schedule it accordingly
Make sure on the edit page of dashboard , View Dasboard as: is selected Run as a specified user
for More detail you can read this article
https://andyinthecloud.com/2015/11/07/supercharging-salesforce-report-subscriptions-with-apex-and-flow/
You can have only one running user at a time and all the recipients will receive the report with that users's context. So, you need to implement the batch apex for this where you can query all the records related to all the users whom you want to send the report and then can send email to the specific users, after, you can schedule the batch as per your requirement.
https://success.salesforce.com/ideaView?id=08730000000Gnk5AAC