1

I have following visualforce page available on Lead layout for adding as inline visualforce page.

<apex:page showHeader="false" sidebar="false" standardController="Lead" extensions="CloudFilesController">
   <!-- code here-->
    <script>
      var objectName = 'Lead';
      // code here
    </script>
    <!-- code here-->
</apex:page>

Except the standard controller and a javascript variable 'ojectName' all the code is same for all objects. I want to automate the creation of these pages for other objects and present user with a setup screen where I list all objects and user can create these by a button click for each objects and then add to Page layout. One way of doing it will be metadata api. I want to do it all in apex so I will probably have to use https://github.com/financialforcedev/apex-mdapi apex wrapper for metadata api.

Are there other ways to do it, any pure apex way?

1

The other alternative will be using tooling API for this requirement.Using tooling API to create these pages should be simple using HTTP callout with session Id.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.