Salesforce is as easy as telling 1, 2, 3. Salesforce visualforce is allow us to create a PDF in simple keyword called renderAs.
HOW TO SHOW CUSTOM BUTTON THAT DISPLAYS PDF
Ok, lets start with creating your visualforce page that renderAs PDF and Add custom button to detail page of the object.
Am using INVOICE object and the Api Name is Invoice__c.
1. Create Visualforce and name as InvoicePDF.vfp
<apex:page standardController="Invoice__c" showHeader="false" sidebar="false" renderAs="PDF">
//do what you want
...........
{!Invoice__c.Name}
.............
//do what you want
</apex:page>
renderAs="PDF" - This will render the visualforce page as PDF.
2. Add the Custom Button(Visualforce button named InvoicePDF.vfp) to Detail Page.(Optional)
Goto,
- Invoice Object
- Scroll down to Buttons, Links and Actions.
- Click new.
- Name the Button.
- Click on Detail Page Button.
- Select Visualforce Page from Dropdown.
- Select InvoicePDF from the list.
- Click on Save and Add to PageLayout.
Recommanded : DOWNLOAD PDF'S AS ZIP FILE FROM LIST VIEW OF THE OBJECT
That's it you have done it. Hope it helps you. Thanks.
See you back. Happy Smile!!.
No comments:
Post a Comment