Is there another way to do this? Email alerts only allow me to pull data from one lead record vs a group of records unless I am missing something.
2 respostas
Hi Jay,
Other option is custom coding. You just need to give the report Id and it will extract the report in Excel/CSV and then you can send the report in attachment using a schedular in email.
Below is the code for help to achieve this.
ApexPages.PageReference objPage = new ApexPages.PageReference('/{!ReportId}?excel=1'); Messaging.EmailFileAttachment objMsgEmailAttach = new Messaging.EmailFileAttachment(); objMsgEmailAttach.setFileName('Testing.xls');
objMsgEmailAttach.setBody(objPage.getContent());
objMsgEmailAttach.setContentType('application/vnd.ms-excel');
If you want to extract report in CSV just replace excel with csv.
Hope this will help !