You need to sign in to do that
Don't have an account?

PageReference getContent() and getContentAsPDF() Methods Behave as Callouts
As per Summer release 15, if someone calling this method will be treated as call out, Does it means that it has timeout of 2 minutes ?
What if customer using getContentAsPDF() method to generate the PDF , Did they get any impact (If they are generating large PDF's)?
What if customer using getContentAsPDF() method to generate the PDF , Did they get any impact (If they are generating large PDF's)?
This critical update changes the way calls made to the PageReference methods getContent() and getContentAsPDF() are treated and improves the semantics of the transaction for the calling page.
A PageReference is a reference to an instantiation of a Visualforce page. The getContent() and getContentAsPDF() instance methods return the content of a rendered page as HTML and PDF, respectively. With this update, calls made to these methods behave as callouts, and the calls are tracked against the limits of the calling transaction.
Best Regards
Naga Kiran
I have code which creates a csv file from a report and emails the CSV to users.
This code is in the form of a VF component that has a page controller that uses the getContent function.
It basically looks like this;
This code will not work with this update.
There was no governor limit warning or any error whatsoever -
it just simply would not work until I deactivated the change and then it worked fine..
I opened a case with Salesforce a few weeks ago and it's still open but it has been escalated by SFDC.
I would advise everyone to test before enabling this critical update.
Beware.
We are running into the same issue. Is there any documentation on what should be done? There doesn't seem to be any fixes to the problem other than not using the getContent() or getContentAsPDF().
I get the following error:
Error is in expression '{!submitHavePricing}' in component <apex:commandButton> in page formpricingsummarypg: Class.EmailFormWithAttachments.SendPricingFormEmail: line 50, column 1
Class.FormPricingSummaryCls.SubmitHavePricing: line 2226, column 1
The code at line 50 is :
// Take the PDF content
Blob b;
if (Test.isRunningTest())
b = Blob.valueOf('Test');
else
b = pdf.getContent();
and Line 2226 is
public PageReference SubmitHavePricing() {
PageReference pr = null;
if (Submit(false)) {
pageController.getRecord();
pr = Page.OpportunityForms;
pr.getParameters().put( 'id', opp.Id );
pr.setredirect(true);
EmailFormWithAttachments.SendPricingFormEmail(f.id, false);
Basically, the 2226 is just calling the PDF to run when you hit submit.
If I turn off the critical update it works.
If the highlighted critical update is deactivated, the problem seems to go away;
I opened a case with SFDC on this, but I don't think it's fixed yet.
Still need to find a workaround.
As a Premier Support customer, I was told my issue (in my post above) will be fixed, but in the meantime to disable the critical update.
Unfortunately, turning it off affects FinancialForce - so I'm stuck too.
Supposedly (from my SFDC rep) he said these issues will be resolved when the critical update is available - I guess we'll have to wait and see :-/
I find it very hard to believe that SFDC will let flagship features like getContent() getContentAsPDF() have such a crippling defect.
I cobbled together a solution to my immediate problem.
I was using getContent() to forward a report in CSV format and using getContent() to format the report into a CSV.
I got around it with a VF component that builds dynamic VF.
The VF email template: The ReportOpportunityExportController component;
The component controller;
The limitation is obvious -- if my report runs past 1000 lines the whole thing fails....
I could get around this by getting away from using the <apex:repeat>, but that's not possible with this solution.
Also, if there was some way to put "readonly=true" in the message template, that would increase my limit to 10,000 rows - which would be like pulling a nail out of my head, but the message:emailtemplate tag doesn't support this, so I'm stuck......
]
In the meantime, I'm constraining the report and just adding more and more reports to the email template.
I don't think this will work with people that require rendering into a PDF format, but I'm posting in case someone might be able to use it.
Edited to add - It works fine if I rerender my page prior to hitting the getContent line, but I would rather not do this as it would just require another unnccessary button click.