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
RaghavenderRaghavender 

Extracting data from a Custom object to a csv/pdf file

Hi ,

I am trying to Extract data from a opportunity and a custom object to a csv/pdf file and then send this file as Attachment.

 

Any help in giving me the right direction is hightly appreciated.


Regards,
Raghu 

WizradWizrad

You create a page with the attribute renderAs="pdf".  Back the page with a controller that queries for the data you need and stores it in public variables.  Display the public variables on the page.  Use getContent() on the page to get your pdf and use it as the body of an attachment.