-1

I have a question i.e. how can I possibly extract meta data of a Visualforce page inside a Page Layout of an object.

For fetching the page layout I use following API request :

https://ap4.salesforce.com/services/data/v43.0/sobjects/Account/describe/layouts

but using this if there is a visualforce page inside a particular page layout, it only shows that a visualforce page has been added, but it doesn't gives what input fields has been there in that particular VF page.

How can I get meta data of a VF page.

Here is where I am insering my VF page : VF page inside Page layout

TIA

4
  • 4
    What's the purpose for what you're trying to do? This may be an X-Y problem.
    – sfdcfox
    Commented Nov 26, 2018 at 18:34
  • Hey, @sfdcfox, here I am trying to obtain the elements used in the visulforce page in a particular page layout and depending on the contents of the page I need to perform some actions. Commented Nov 26, 2018 at 18:43
  • Question has been edited to give better clarity of my problem Commented Nov 26, 2018 at 18:44
  • 3
    Again, why do you want this? What's the reason behind it? What are you attempting to accomplish? Did you read the previous link?
    – sfdcfox
    Commented Nov 26, 2018 at 18:54

1 Answer 1

1

Once you have the Visualforce page name(s), retrieve the Visualforce page contents via the Metadata API and decode the content from base64 to binary.

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_pages.htm

Parse the text content of the page to identify fields (for example, find all apex:inputField elements) and extract their names.

Because the field names occur in a whole plethora of different Visualforce components and HTML elements, this is not an extensible solution, but it could accomplish the task for a specific page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .