function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
raseshtcsraseshtcs 

Account New Button override

Hi All,

 

Is there a way to override the new button of account with a visualforce page and then provide a link/button on the page itself which redirects the user to the stabndard create page of the account without the override.

What I need to do is to make account search mandatory before creation. User is redirected to a search page on click of new, now if the user feels that the account is not present in the system he/she should be able to click on a link to create page of account.

 

Thanks in Advance

Rasesh

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Use the following link:

 

 

{!URLFOR($Action.Account.New,null,null,true)}

URLFOR is a formula function that accepts 3 to 4 parameters. The first is the name of the action to perform, the second is the ID of the existing record (null, because it's new!), the third are parameters to pass to the page (if present, should be in the form of [field1=value1,field2=value2], including square brackets, as shown), and the final (optional) parameter is the magic bit that forces Force.com to override the override, such that the standard behavior will be invoked. See Help & Training for details on the URLFOR formula. Use it in an apex:outputLink or as part of your JavaScript (window.top.location.href = "...").

 

 

 

All Answers

sfdeveloper9sfdeveloper9

on click of link/button redirect to the below url

https://na7.salesforce.com/001/e?nooverride=1&retURL=.......

include recordTypeId param also if you have recordTypes

 

PK

sfdcfoxsfdcfox

Use the following link:

 

 

{!URLFOR($Action.Account.New,null,null,true)}

URLFOR is a formula function that accepts 3 to 4 parameters. The first is the name of the action to perform, the second is the ID of the existing record (null, because it's new!), the third are parameters to pass to the page (if present, should be in the form of [field1=value1,field2=value2], including square brackets, as shown), and the final (optional) parameter is the magic bit that forces Force.com to override the override, such that the standard behavior will be invoked. See Help & Training for details on the URLFOR formula. Use it in an apex:outputLink or as part of your JavaScript (window.top.location.href = "...").

 

 

 

This was selected as the best answer