WinsurTech Blog | Insurance Concepts and Practical Solutions

Salesforce | System.VisualforceException: Getting content from within triggers not supported

Author - Webner
|
5:41 am
|
1 Comment
| |

Problem: System.VisualforceException: Getting content from within triggers is currently not supported.

Description: This Visualforce exception occurs when we use getContent method in the trigger of sobject.

Here is the code for which we got this exception:

Trigger code:
trigger updateStatus on sobject (before update) {
List List = new List();
for(sobject term : Trigger.new){
sobject oldOpp = Trigger.oldMap.get(term.Id);
if(term.Payment_Status__c ==’Paid’){
Messaging.SingleEmailMessage emailTobeSent = new Messaging.SingleEmailMessage();
PageReference pdf = Page.templateCOI; //Replace attachmentPDF with the page you have rendered as PDF
pdf.getParameters().put(‘Id’,term.Id);
pdf.setRedirect(true);
Attachment attach = new Attachment();
Blob b […]

‹ Prev page1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 
Contact Us