You need to sign in to do that
Don't have an account?

Lightning button for a VF page which renders a PDF
I have written a lightning cmp and controller for a button which calls a VF pagw which renders PDF
CMP
Controller :
I'm unable to save my controller as its throwing an error msg
VF page
Custom Button:
window.open("apex/Letter?Id={!Letter__c.Id}","_blank");
CMP
<aura:component implements="force:lightningQuickAction" > <lightning:button label="PDF" onclick="{!c.PDF}" /> </aura:component>
Controller :
/* Component controller */ ({ PDF : function(sforce.one.navigateToURL('/apex/Letter?Parameter1=data1')); })
I'm unable to save my controller as its throwing an error msg
VF page
<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false"> <head> <style> body { font-family: 'Arial Unicode MS'; } @page{ size: letter; margin:10%; @top-left{ content: "Dear,"; font-family: Helvetica, Arial, sans-serif; font-size: 12px; } @bottom-right{ content: "Yours Sincerely,"; font-family: Helvetica, Arial, sans-serif; font-size: 10px; } } body { font-family: Helvetica, Arial, sans-serif; font-size: 11px; } </style> </head> <div align="right"><strong>Date</strong>: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}</div> <center> <h1> Letter</h1> </center> <p>{!custom_object__C.Name__C}</p> </apex:page>
Custom Button:
window.open("apex/Letter?Id={!Letter__c.Id}","_blank");
Thanks.
I just changed my cmp code where I have used handle.click for my button, record.ID attribute for the page ID and have written a JS for my handle.click and record.ID in controller.
Then I have created a quick action for the button
All Answers
Try for this code.
========================== VF Page ===================================
If you found this answer helpful then please mark it as best answer so it can help others.
Thank You
Akshay
Thanks.
I just changed my cmp code where I have used handle.click for my button, record.ID attribute for the page ID and have written a JS for my handle.click and record.ID in controller.
Then I have created a quick action for the button