Is it possible to show the standard "new" for a standard object page with visualforce? Or do you have to recreate all fields in your VF page?

Something like <apex:detail > just for the new button.

  • 1
    Then why override in the first place?
    – Adrian Larson
    Sep 7 '16 at 13:04
  • I want to dynamically update some values when a user selects a certain drop down value. Multiple values depend on these so I want to update them via JS Sep 7 '16 at 13:13
  • The simplest implementation is likely to use Field Sets. Does Working with Field Sets look like it might get you what you need?
    – Adrian Larson
    Sep 7 '16 at 13:22
  • @AdrianLarson That looks good. It is definitely less work and cleaner than recreating the whole page layout with single field tags. Could you post that in an answer? Sep 8 '16 at 12:20
  • Will do shortly.
    – Adrian Larson
    Sep 8 '16 at 13:09

When I've tried to recreate Page Layouts in the past using Visualforce, I turned to Field Sets. Here is the example in Working with Field Sets :

<apex:page standardController="Contact">
    <apex:repeat value="{!$ObjectType.Contact.FieldSets.properNames}" var="f"> 
        <apex:outputText value="{!Contact[f]}" /><br/>

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.