Is there any way to set up an alert message when a user clicks the "New" button either on the Opportunity object or on the account related list? I don't think creating a new button will help because then I cannot get rid of the standard "New" button across Salesforce for the Opportunity.

Is there an easy way to get rid of all the "New" buttons that pertain to opportunities across the platform? My ultimate goal is to still have my end users creating opportunities, but from the custom button I have created and not the standard button that Salesforce provides.

Any ideas would be appreciated. Thanks!

  • What's the content source for your button - URL, Custom S-Control, JavaScript or Visualforce? There should be a way to set a value through the button which if not entered for the Opportunity, triggers the alert..
    – Alex S
    Commented Jun 25, 2015 at 16:36
  • I don't want to set a value on the Opportunity through the button, I just want an alert message to pop up and let the end user know that the ability to create an opportunity from the standard "New" button is going to go away as of Aug 1st. Commented Jun 25, 2015 at 16:56

1 Answer 1


You can override the Standard new button to take to a vf page that simply shows a message "You must create an opportunity from the Account" or something similar. You then remove the standard new button everywhere you can and replace with your custom New button. For those places where you cannot remove the new button the VF page would be displayed

<apex:page standardController="Opportunity">

<p>You cannot create an opportunity from here</p>
<apex:commandbutton action="{!cancel}" value="Return" rerender=""/>

  • I want to just display an alert message like "This feature will be going away as of August 1st" since we don't want to cut the end users off cold turkey. Come August 1st, I can implement what you are saying, but in the mean time I want to create the alert message and then have the page redirect to the standard opportunity edit page. Commented Jun 25, 2015 at 16:55
  • You can't without a lot of effort to work around the sidebar hack being removed. There are some good posts here using static resources IIRC, I do not have the link handy.
    – Eric
    Commented Jun 25, 2015 at 17:17
  • @newbiedeveloper27 OP could use a pageAction method to redirect to standard Edit page before August 1 and otherwise display an 'instruction' page after aug 1. Place the aug 1 date in a custom setting
    – cropredy
    Commented Jun 25, 2015 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .