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
vijayk1.393339369954256E12vijayk1.393339369954256E12 

How to get content of visualforce page using trigger or async jobs

Sagar PareekSagar Pareek
This question is bit tricky.

Are you trying to call a vf page from trigger ? If yes then answers is no. 

If you are trying to access contents of visualforce , then what contents you are trying to access - the answer here is also no but in case you want to access data from database you can simply query it from object on which the page is developed
AshlekhAshlekh
Hi,

In trigger and future method we can't use getContent() method of PageReference.

But here is workaround for this https://developer.salesforce.com/forums?id=906F00000008yDgIAI


Please mark as solution if it helps you. Enjoy Apex.
 
surasura
there is a seperate standard object called ApexPage . you can use it to get page content.

eg:- 
SELECT ApiVersion, ControllerKey, ControllerType, CreatedById, CreatedDate, Description, MasterLabel, LastModifiedById, LastModifiedDate, Markup, Name, NamespacePrefix, Id, SystemModstamp FROM ApexPage