You need to sign in to do that
Don't have an account?
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 = '<input value=\"Save to Quote\" class=\"btn\" name=\"save\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\" title=\"Save to Quote\" type=\"button\" /><input value=\"Save and Email Quote\" class=\"btn\" name=\"saveAndEmail\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\" title=\"Save and Email Quote\" type=\"button\" /><input value=\"Cancel\" class=\"btn\" name=\"cancel\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\" title=\"Cancel\" type=\"button\" />'; 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?
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
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?
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
Sure, you can call methods from the standard controller from within your Apex class
ApexPages.Standardcontroller controller;
Then call methods on the controller variable.
Did you get a solution for this?
cheers