Override "New" Action

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Would love to do an override for the "new" action. You guys have great tutorials for view/edit and tab - but not for new. Can you help?
Photo of Kaede Holland

Kaede Holland

  • 3,016 Points 3k badge 2x thumb
  • still very happy

Posted 6 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema

  • 10,910 Points 10k badge 2x thumb
For sure, Kaede, I'll work on making a "new" override tutorial.
The process is basically the same:

  1. In Setup, create a Visualforce page for your New Page.
  2. Are you using page assignments?
    • If you are, then use this markup for your page, substituting the name of your object (like Project__c) for "Holiday__c."

    • If you're not using page assignments, use this one (substitute your own object and page name):

  3. Then, go to Create > Objects [or Customize > Object for standard objects] and click on the object this new page is for. In "Buttons and Links," click Edit next to the New action, and select your new VF page for the override

Does that make sense? Let me know if this doesn't work or if you have any more questions.
Photo of Anna Wiersema

Anna Wiersema

  • 10,910 Points 10k badge 2x thumb
Also, if it doesn't work, try changing {!redirect}? to {!redirect}& or vice versa. That's what always gets me.

Also, your new tutorial is online now!
Photo of Zach McElrath

Zach McElrath, Employee

  • 52,276 Points 50k badge 2x thumb
For a new page, the syntax should be action="{!redirect}?objectType=Account&actionType=New", if you're using Page Assignments, or action="{!redirect}?page=NewAccount", if you're just doing simple redirects.
Photo of Sharon Anoop

Sharon Anoop

  • 232 Points 100 badge 2x thumb
Hi Zach,
Is it possible to have two action types in the same VF page i.e. New as well as edit?