You need to sign in to do that
Don't have an account?
Leafen Sandy
Scheduler apex class to run and email reports
Hi,
My exact requirement is as follows,
I have a custom object, say myreports__c, where in each record user will choose a report name in a lookup field and will have a time field, an email field and a date field.
So, now I've to query these records each day which has the today's date in the date field and need to run and email the selected report in those records at the mentioned time.
Even a sample or suggestive code will be greatly helpful.
Thanks,
Leafen Sandy
My exact requirement is as follows,
I have a custom object, say myreports__c, where in each record user will choose a report name in a lookup field and will have a time field, an email field and a date field.
So, now I've to query these records each day which has the today's date in the date field and need to run and email the selected report in those records at the mentioned time.
Even a sample or suggestive code will be greatly helpful.
Thanks,
Leafen Sandy
May I request you to please refer the below link for reference.
- http://sfdchackathon.blogspot.sg/2015/04/how-to-generate-weekly-report-and-sent.html
- https://developer.salesforce.com/forums/?id=906F00000009033IAA
I hope it will be helpful.Please mark it as best answer if the information is informative.so that they are removed from unanswered questions and more app as a proper solution to Similar kind of Issue.
Best Regards
Rahul Kumar
We can't create lookup field with report object. You have to create a dynamic picklist on vf page for this.
try this:
VF Page:
Apex Controller:
Scheduler Class
Thanks,
Ankur Saini
http://mirketa.com
Thanks for your help,
But here I like to make myself even more clear, I've already created the vf page and controller to insert records having the chosen report with desired email, date and time.
So now my only part is to create a scheduler class which should pick these records from that object and run the report given in it and email that report.(Also I need to receive the report in the body of the mail like the standard functionality, not as an attachment).
So kindly guide me through from here.
Thanks,
Leafen.