Is it possible to exclude a visualforce page that will be used for rendering a PDF from a managed package?
The reason is, we have a standard PDF layout, but we want to give our clients the possibility in changing the layout of the pdf, in order to create their own branded version of the pdf.
I was thinking about, not including the pdf in a package, not including the button on the page layout that generates the pdf either (which generates the pdf, and adds it as an attachment to the SObject), and just create an unmanaged "support" package that includes the default pdf, and the button (the button calls a webservice method via javascript).
But then comes the problems i'm thinking about.
- In the apex webservice method, I reference the page via Page.PDFPageName, but since the page isn't included in the package, i'm not sure if the deployment would fail.
- Some use cases require the pdf to be generated from code (in some cases, when the sobject gets made, the pdf gets autogenerated)
How would one start of implementing this, (if its possible at all)
new PageReference('/apex/ns__PDFPageName')
is functionally identical toPage.PDFPageName
, but removes the compile-time dependency - one could use that to decouple the page from the apex webservice package