You need to sign in to do that
Don't have an account?
Kiran Kumar Punuru
Generate pdf for a custom object
Hi ,
I have a requirement like this ,I have a custom object which related to account,opportunity when a value of a field in custom object is changed from one to another i need to send an email with pdf as attachment.
The attached pdf should contains 4 tables :
1)Account Information
2)Custom Object Information
3)Opportunity Information
4)Opportunity Product Information
Can you help me how to achieve this i already tried but not getting desired result.
Thanks,
Kiran
I have a requirement like this ,I have a custom object which related to account,opportunity when a value of a field in custom object is changed from one to another i need to send an email with pdf as attachment.
The attached pdf should contains 4 tables :
1)Account Information
2)Custom Object Information
3)Opportunity Information
4)Opportunity Product Information
Can you help me how to achieve this i already tried but not getting desired result.
Thanks,
Kiran
Are you using Custom VF page for saving Custom object record? If yes,
- overwrite the Save button and call the apex method
- call another VF page and send List of records using wrapper.
- The vf page should save the attachment as PDF.
- Email the PDF in vf controller.
Hope this helps, let me know if you need more insight on this.Thanks,
Gaurav
I am not using custom VF page I am just calling email handler class on field update in that email handler i am rendering html to pdf but here all the tables and styles are not appearing in the generated PDF.
Thanks,
KiranKumar
- May I suggest You can use the renderAs option in apex: page tag.
It will look like this (below) in your VF page.Please refer the reference links below for more information on this.
- https://help.salesforce.com/articleView?id=000004706&type=1
- https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_renderas_pdf.htm
Hope it will be helpful.Please mark it as best answer if the information is informative.
Thanks
Rahul Kumar
Please add styling with border-width: 1px and other table style if required.
hope this helps.
Thanks,
Gaurav