Thursday 10 December 2015

PageReference getContent() and getContentAsPDF() Methods Behave as Callouts - Critical Updates Salesforce

Important Note:

Please note down the below points as per the salesforce documentation,

To ensure a smooth transition, each critical update has an opt-in period, which ends on the auto-activation date that’s displayed on the Critical Updates page in Setup. During this period, you can manually activate and deactivate the update as often as you need to evaluate the impact on your organization and modify affected customization. After the opt-in period has passed, the update is automatically activated. 

Released history about Actual changes on getContent() and getContentAsPDF() methods:

In Summer ’15 we made a change to the behavior of the getContent() and getContentAsPDF() methods of the PageReference object. This change was released as a critical update named “PageReference getContent() and getContentAsPDF() Methods Behave as Callouts” and was scheduled for auto-activation in Winter ’16. 

Auto activation date:

This critical update will automatically activated in Spring 16 release.

Note: On the scheduled auto-activation date, Salesforce permanently activates the update. After auto-activation, you cannot deactivate the update.

Faced issue:

Recently we have faced an real time issue due to this critical update. The issue follow as,

     From visualforce page, I have inserted a record and created a save point. After a savepoint i am rendered a page as PDF by using getContentAsPDF method. So i have received an error as "You cannot make callout after creating a Savepoint".

1 comment:

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...