+ Start a Discussion
Matt1000Matt1000 

Override quote "Create PDF" button to show VisualForce page and display in pdfOverlay

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

 

super developersuper developer

Can you explain me what you exactly needed

..

If create pdf button is a custom  Button then go for java script

 

Like window.open();

 

If it is standard it will give choiceto override it with vf page

 

Matt1000Matt1000

I must not have explained it clearly enough.

 

"Create PDF" is not a custom button. It is a built in button on any quote page.

 

When the user clicks the standard Create PDF button from a Quote details page, a PDF preview of the currently selected quote template appears. That preview screen (an overlay) has 3 standard buttons on it. We would like to preserve all this built-in behavior, but show a custom PDF quote instead. We do not want to use a quote template, but refer to our own visualforce page rendered as a PDF within that overlay. We want to preserve the 3 standard buttons (Save to Quote, Save and Email Quote, and Cancel). To see this, go to a quote and click "Create PDF."

 

If we override the built in "Create PDF" button and point it to our own Visualforce page rendered as a PDF, we lose the overlay behavior, and we lose the built-in buttons (Save to Quote, Save and Email Quote, and Cancel buttons).

 

How can we preserve the built-in behavior, but use our own PDF visual force page in that PDF preview?

 

Does this help explain the need?

 

 

b-Forceb-Force

Mat,

 

the Rendered page is inbuilt page from Salesforce.com,

 

I dont think it will be possible to render some other vf page and use existing all functionality like, send email, Save to quotes and so on.

 

either we need to implement these functionality in VF page, or go for the standard functionality.


we can popup some VF page in some similar to existing functionality.

 

But need to implement all other custom things.

 

Thanks,

Bala

kardoluskardolus

Sure, you can call methods from the standard controller from within your Apex class

 

ApexPages.Standardcontroller controller;

 

Then call methods on the controller variable.

 

SoleesSolees

Did you get a solution for this?

 

cheers




Marco Pierre Fernandez BurgosMarco Pierre Fernandez Burgos
Did you get a solution for this?
Amit TekaleAmit Tekale
Please share solution . I am also looking for a solution for the same.