2020年10月6日 星期二

Chome直接預覽PDF 造成 setRedirect(false) 的作法Class內容遺失, 下載PDF會失敗

 Chome直接預覽PDF 造成 setRedirect(false) 的作法Class內容遺失, 下載PDF會失敗


==> 外面包一層強制下載PDF

PS. Controller & extensions 要一致
      Style要再寫才能顯示中文,跟頁面大小


<apex:page standardController="Account" extensions="TW_InvestmentReport" contentType="application/vnd.ms-pdf#output.pdf">   
    <head>
  <style type="text/css"  media="print">      
              @page {                                                     
                  @top-center {                   
                      content: element(header);    
                  }
              @bottom-left {
                      content: element(footer);
                  }
                  size: 297mm 210mm;
                  margin: 15mm;
                  margin-right:0mm;
                
                  margin-top: 2.80cm;
                  margin-bottom: 2.80cm;
                  margin-left: 1.27cm;
                  margin-right:1cm;
                        
              }                              
            body { font-family:Arial Unicode MS; font-size:10px;}
            
  </style>
    </head>
    <apex:include pageName="TW_InvestmentReportPDF"/>        
</apex:page>

2020年9月21日 星期一

Lightning New Page 網頁轉址傳送參數

 

Custom Button URL Hacking in Salesforce Lightning Experience vs Salesforce Classic

To Show Record Type Selection in Record’s Create Page with Default Field Values:-

/lightning/o/Contact/new?useRecordTypeCheck=1

Set Default Record Type value in Record’s Create Page with Default Field Values:-

Note: recordTypeId   (here recordTypeId  follow the case sensitive i.e T and I capital letters)

/lightning/o/Contact/new?recordTypeId=0122v000001SmZ2AAK&
defaultFieldValues=
LastName={!URLENCODE(Account.Name)},
Phone={!Account.Phone},
Languages__c=English

Set Date field values in Record’s Create Page with Default Field Values:-

/lightning/o/Contact/new?recordTypeId=0122v000001SmZ2AAK&
defaultFieldValues=
LastName={!URLENCODE(Account.Name)},
Phone={!Account.Phone},
DateOfBirth__c={!TEXT(TODAY() )}

To pass the date value to convert as String value using TEXT() – https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_lc_navigate_to_record_dfv.htm



參考網址:

http://theblogreaders.com/custom-button-url-hacking-salesforce-lightning-experience-vs-salesforce-classic/