You need to sign in to do that
Don't have an account?
vinita kumari 8
How to access outside package code from Managed Package Code
Hi,
I have developed a functionality in Managed Package which need to access org specific VF page (VF page is mentioned in Custom setting).
When the package code calls the page to generate the a PDF its gives error.
// Managed package code
PDFSetting = PDFCustomSetting__c.getOrgDefaults();
String pagename = PDFSetting.PDF_Page_Name__c.trim(); // VF page name defined in custom setting
PageReference pdfPage = new PageReference('/apex/'+pagename+'?id='+record.id);
Error: PDF generation failed. Check the page markup is valid
Please suggest a solution to access the page or anyother workaround to generate PDF from package code.
I have developed a functionality in Managed Package which need to access org specific VF page (VF page is mentioned in Custom setting).
When the package code calls the page to generate the a PDF its gives error.
// Managed package code
PDFSetting = PDFCustomSetting__c.getOrgDefaults();
String pagename = PDFSetting.PDF_Page_Name__c.trim(); // VF page name defined in custom setting
PageReference pdfPage = new PageReference('/apex/'+pagename+'?id='+record.id);
Error: PDF generation failed. Check the page markup is valid
Please suggest a solution to access the page or anyother workaround to generate PDF from package code.
Are you able to access and view that page correctly while opening it as standalone page. Please make sure that page name is correctly being passed.
Please mark this as best abswer if it helps
Thanks
Siddharth
OSI Consulting
There are some of my observation details:
1. When I passed Package page name (a different page which is a part of package) in custom setting. It works perfectly fine.
2. When I copied package code on that org and then passed the page name (which is currently showing error ) in custom setting it works fine.
It looks like package code works fine package pdfpage. And code copied to org from package works fine with pdfpage written on that org.
Is there any limitation that package code will not able to access the org code???