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
bzain9bzain9 

Creating a new VF page to execute when "New Account" is clicked on the Account Tab

How would I go about creating a new VF page to execute when "New Account" is clicked on the Account Tab. Just the generic look. Sample code would be great!
Best Answer chosen by bzain9
Maharajan CMaharajan C
Hi,

please create the below VF page:

<apex:page StandardController="Account">
<apex:form >
<apex:pageBlock title="Account Details">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!Account.Name}"/>
<apex:inputField value="{!Account.AccountNumber}"/>
<apex:inputField value="{!Account.Type}"/>
<apex:inputField value="{!Account.NumberOfEmployees}"/>
<apex:inputField value="{!Account.Industry}"/>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>  
</apex:page>

Then Setup->Account->Buttons and Links->Edit on New->override with visualforce page and select the above VF page->save.

Let me know if it works or not!!!

If it works mark this as a best answer!!!

Thanks,
​Raj