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
padmapadma 

Ovrride Buttons

 Hi ,
  if any body  know  help me .how to override a buttons in salesforce. with Vf pages.
 Thanks,
padma.
 
KaranrajKaranraj
Check this link to see, steps to override button in salesforce with VF page- https://help.salesforce.com/HTViewHelpDoc?id=links_customize_override.htm
Check this link for consideration for overirding standard button in salesforce - https://help.salesforce.com/HTViewHelpDoc?id=links_override_considerations.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=links_override_considerations.htm&language=en_US)
Vijay NagarathinamVijay Nagarathinam
Hi Padma,

Choose your object -> click Buttons, Links and Action -> choose the Button you want to override -> Edit -> Choose override vfpage checkpage -> choose your visualforce page and then click save.
sfdc550sfdc550
By using visualforce pages we can override standard buttons. This example helps you to understand how you can overriding standard button with visualforce page.  In this example i am creating visualforce page called “newopportunitycreatepage”  and I am overriding standard new button with above created visualforce page.
 
<apex:page standardController=”Opportunity” sidebar=”false”>
<apex:form >
<apex:pageBlock title=”Opportunity Detail”>
<apex:pageBlockbuttons >
<apex:commandButton value=”Save Opportunity” action=”{!save}”/>
</apex:pageBlockbuttons>
<apex:pageBlockSection title=”Opportunity Information 1″ columns=”2″ collapsible=”false”>
<apex:inputField value=”{!opportunity.Name}”/>
<apex:inputField value=”{!opportunity.Active__c}”/>
<apex:inputField value=”{!opportunity.DeliveryInstallationStatus__c}”/>
<apex:inputField value=”{!opportunity.TrackingNumber__c}”/>
<apex:inputField value=”{!opportunity.CloseDate}”/>
</apex:pageBlockSection>
<apex:pageBlockSection title=”Opportunity Information 2″ columns=”2″ collapsible=”false”>
<apex:inputField value=”{!opportunity.Description}”/>
<apex:inputField value=”{!opportunity.LeadSource}”/>
<apex:inputField value=”{!opportunity.NextStep}”/>
<apex:inputField value=”{!opportunity.Type}”/>
<apex:inputField value=”{!opportunity.StageName}”/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

Now we are ready with our vf page, next step how to override standard opportunity new button.

Steps to overriding standard buttons

Go to setup -> opportunity -> Buttons,links, and actions, then click edit on new action. see below image for reference.


User-added image

Next select override with visualforce option and select “newopportunitycreatepage” you created above and save your changes. See the below image for reference.

User-added image

Now you are done with overriding your standard opportunity new button. 


If this answers you question, please mark it as "Best Answer" so it will help other community members too.