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

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

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

But here is workaround for this

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

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