function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rekha sharmarekha sharma 

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

I am taking reference from here to create an attachment , Can i use the same from trigger instead of button.I am getting

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

Please Help.

Best Answer chosen by Admin (Salesforce Developers) 
rekha sharmarekha sharma

I found a post http://corycowgill.blogspot.in/2012/02/generating-pdf-in-apex-trigger.html as a solution.still i am looking for any easy way to get the content s just look like  printable view. 

All Answers

rekha sharmarekha sharma

I found a post http://corycowgill.blogspot.in/2012/02/generating-pdf-in-apex-trigger.html as a solution.still i am looking for any easy way to get the content s just look like  printable view. 

This was selected as the best answer
Fabiano AlbinoFabiano Albino
Add a @Future(callout=true) in your method.
David WeryDavid Wery
@Future worked for me, thanks Fabiano !