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
KayalKayal 

How to get list of Visualforce pages

Hi All,

 

In my c# application, is it possible to retrive the list of Visualforce pages created in SF through Your Name | Setup Develop | Pages?? Any suggestion would be of great help.

 

-Kayal

Kartik PerisetlaKartik Perisetla

Hi Kayal,

 

You can achieve this in 2 ways:

 

(1) Using SOQL to get list of pages:

You may invoke this statement to get list of pages, their name, api version and their markup( raw vf data):

 

You can execute this in Developer console as Anonymous block:

 

LIST<ApexPage> lst=[select name,apiversion, markup from ApexPage];
system.debug(lst);

 

(2) Using Metadata API: using this API you can query all metadata components of type "ApexPages"

The Benefit of using Metadata API is that you can also create vf page from your .net client or java client which is consuming metadata API WSDL. If you wish to get better control on metadata components in yuor salesforce org then go for Metadata API.

 

I hope you find this response useful.

 

Cheers !