I want to define and create a new VF page dynamically, in Javascript or Apex (or whatever I can use). Is this possible at all? If so what technology allows this (e.g. Metadata API) and is there a sample somewhere I could use?



You should be using the Tooling API in order to achieve that. There is a lot of documentation around that, please check this link.

Few examples can be found here and here.

Also, there is already a similar question posted on this site.

  • @user1936026 This may be helpful. Just found in Google search: intmist.wordpress.com/2014/03/09/… – Ashwani Mar 31 '14 at 10:11
  • @regal Wow that's amazing! Great find. Thanks for sharing! – Mossi Apr 2 '14 at 6:02
  • I am now able to create the VF page in Apex. But how do I set its security settings? I have looked through the API Guide and haven't found anything useful. – Mossi Apr 6 '14 at 9:26

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.