• Marco Pierre Fernandez Burgos
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi all,

The default templates to create a Quote are really limited, so we decided to use VisualForce to enrich our PDF Quotes. Now we want to include this VisualForce page on the Quotes templates.  Can you please explain to me how to accomplish this task? 

I am asking this question because we will build up our own system for this if there is no standard configuration.

I found the below link with the same question. However, I did not see any proper answer that is why I am asking again:

https://developer.salesforce.com/forums/?id=906F00000008rYXIAY
 

On the SF Quote Page, I see that I can override Create PDF to show my own VIsualForce page. I can also "RenderAs" a PDF. This works as expected.

 

But how can I show my own VisualForce page in the pdfOverlay that is shown when the user clicks "Create PDF" when there is no override. In this case, a standard template is served up on the "pdfOverlay" window, with default buttons (Save to Quote, Save and Email Quote, and Cancel).

 

I want my Visualforce quote document to appear in that window, using those same buttons.

 

Basically, I want to use my own template via a VIsualforce page, rather than the more restrictive Templates available to us via the standard quote templates. The template layout options just don't seem to permit the coplexity I need. For example, it is not possible (I think) to create multi-page Terms & Conditions, and lengthy paragraph language to develop a longer form quotation to the customer.

 

Is there a simple way to reuse that PDF overlay with my own VIsualForce PDF, including the existing "Save to Quote" (etc.) buttons in the PDF Overlay ?

 

This would save me lots of time.

 

P.S. The SF Quote page's HTML source shows the following, which is why I thought pdfOverlay had some relevance:

 

HTML Snippet From SF Quote Page:

 

 

<input value="Create PDF"  class="btn" title="Create PDF" name="createpdf" onclick="null
 var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];pdfOverlay.dialog.buttonContents = '&lt;input value=\&quot;Save to Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;save\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\&quot; title=\&quot;Save to Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Save and Email Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;saveAndEmail\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\&quot; title=\&quot;Save and Email Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Cancel\&quot;  class=\&quot;btn\&quot; name=\&quot;cancel\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\&quot; title=\&quot;Cancel\&quot; type=\&quot;button\&quot; /&gt;';
pdfOverlay.summlid = '0EHE0000000PCKI';
pdfOverlay.setSavable(true);
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id=0Q0E0000000TNLo','/quote/quoteTemplateHeaderData.apexp?id=0Q0E0000000TNLo');
pdfOverlay.display();
" type="button" />

Any advice to get to this solution? 

 

Thanks, Matt

 

On the SF Quote Page, I see that I can override Create PDF to show my own VIsualForce page. I can also "RenderAs" a PDF. This works as expected.

 

But how can I show my own VisualForce page in the pdfOverlay that is shown when the user clicks "Create PDF" when there is no override. In this case, a standard template is served up on the "pdfOverlay" window, with default buttons (Save to Quote, Save and Email Quote, and Cancel).

 

I want my Visualforce quote document to appear in that window, using those same buttons.

 

Basically, I want to use my own template via a VIsualforce page, rather than the more restrictive Templates available to us via the standard quote templates. The template layout options just don't seem to permit the coplexity I need. For example, it is not possible (I think) to create multi-page Terms & Conditions, and lengthy paragraph language to develop a longer form quotation to the customer.

 

Is there a simple way to reuse that PDF overlay with my own VIsualForce PDF, including the existing "Save to Quote" (etc.) buttons in the PDF Overlay ?

 

This would save me lots of time.

 

P.S. The SF Quote page's HTML source shows the following, which is why I thought pdfOverlay had some relevance:

 

HTML Snippet From SF Quote Page:

 

 

<input value="Create PDF"  class="btn" title="Create PDF" name="createpdf" onclick="null
 var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];pdfOverlay.dialog.buttonContents = '&lt;input value=\&quot;Save to Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;save\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\&quot; title=\&quot;Save to Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Save and Email Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;saveAndEmail\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\&quot; title=\&quot;Save and Email Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Cancel\&quot;  class=\&quot;btn\&quot; name=\&quot;cancel\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\&quot; title=\&quot;Cancel\&quot; type=\&quot;button\&quot; /&gt;';
pdfOverlay.summlid = '0EHE0000000PCKI';
pdfOverlay.setSavable(true);
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id=0Q0E0000000TNLo','/quote/quoteTemplateHeaderData.apexp?id=0Q0E0000000TNLo');
pdfOverlay.display();
" type="button" />

Any advice to get to this solution? 

 

Thanks, Matt