You need to sign in to do that
Don't have an account?
suji srinivasan
How to attach vf page as pdf attachment in email ?
Can anyone guide me how to use this in vf components or can i attach this directly in email template?
vf page
<apex:page standardController="Salary_Detail__c" extensions="salarydetails" renderAs="pdf" >
<table>
<apex:repeat value="{!Salary_Detail__c}" var="a" >
<tr>
<td >Emp Code</td>
<td >{!Salary_Detail__c.Employee_ID__c}
</td>
</apex:repeat >
</table> </apex:page>
-------------------
vf page apex class
public class salarydetails {
public Salary_Detail__c SalaryDetail{get;set;}
private ApexPages.StandardController controller;
public SalaryDetails(ApexPages.StandardController controller){
//this.SalaryDetail = (Salary_Detail__c)StandardController.getRecord();
}
Public PageReference saveRecord() {
insert SalaryDetail;
PageReference pr = new PageReference('/'+SalaryDetail.id);
pr.setRedirect(true);
vf page
<apex:page standardController="Salary_Detail__c" extensions="salarydetails" renderAs="pdf" >
<table>
<apex:repeat value="{!Salary_Detail__c}" var="a" >
<tr>
<td >Emp Code</td>
<td >{!Salary_Detail__c.Employee_ID__c}
</td>
</apex:repeat >
</table> </apex:page>
-------------------
vf page apex class
public class salarydetails {
public Salary_Detail__c SalaryDetail{get;set;}
private ApexPages.StandardController controller;
public SalaryDetails(ApexPages.StandardController controller){
//this.SalaryDetail = (Salary_Detail__c)StandardController.getRecord();
}
Public PageReference saveRecord() {
insert SalaryDetail;
PageReference pr = new PageReference('/'+SalaryDetail.id);
pr.setRedirect(true);
return pr;}}
Thanks in advance
Thanks in advance
Please follow below url, that's will help for your solution
https://salesforcescool.blogspot.com/2019/01/send-pdf-as-attachment-in-visualforce.html
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Hi Suji,
Please refer the below links for reference :-
https://developer.salesforce.com/forums/?id=906F0000000MGuwIAG
https://success.salesforce.com/answers?id=90630000000gtkuAAA
https://salesforce.stackexchange.com/questions/330888/how-can-a-vf-page-be-attached-to-an-email-as-a-pdf-attachment-in-landscape-forma
hope it will be helpful.
Please mark it as best answer if the information is informative.
Thanks & Regards,
Priya Ranjan
Please follow below url, that's will help for your solution
https://salesforcescool.blogspot.com/2019/01/send-pdf-as-attachment-in-visualforce.html
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh