You need to sign in to do that
Don't have an account?
Creating Visualforce pages dynamically
I'm developing a wizard that lets user choose the steps they want to use based on pre-existing visualforce pages. And its coming along nicely. However it did raise a question in testing - which led to a thought :manhappy:.
Good testing practice indicates that you should not assume that data, such as a particular account, exists and that you should create test data in the Test Buildup. In this case I'm using an SObject to store the URL's of certain VisualForce pages, yes I know I could populate the SObject in the Test Code with known VF pages (which is what I'll probably have to do).
BUT, and this is out of technical curiousity, is there a way to dynamically (i.e. use APEX) to create a visualforce page?
I'm afraid not - pages can be created via the metadata api, but that's not available via apex.
All Answers
I'm afraid not - pages can be created via the metadata api, but that's not available via apex.
Thanks. The Meta Data approach is for a different scenario, useful to know though