1. Get Id from current page 1.1 Add 'force:hasRecordId' to implements <aura:component implements="force:hasRecordId"> 1.2 Create attribute to receive Id <aura:attribute name="recordId" type="Id" /> 1.3 In controller js component.get("v.recordId");
7. How to render Visualforce page to PDF then Download it. 1. You need to have two page first page is main page <apex:page id="MainPage" showHeader="false" cache="true" contentType="application/x-pdf#PDF_Name.pdf" <apex:include pageName="SecondpageName"/> </apex:page> 2. your second page <apex:page renderAs="pdf" >//your code</apex:page>
1. @RemoteAction : use to call method from page to class by js In Apex class: @RemoteAction global static List<Account> getAccounts() { //your code } In JS method: function getAllAccount(){ // call method from saleforce class Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.OfficeLocatorController.getAccounts}', function(responseAccounts, event){ initialize(responseAccounts) },{escape: true} ); }
Comments
Post a Comment