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
Daniel BallingerDaniel Ballinger 

Custom Button on new Opportunity Page that links to Visualforce Page on Save

I've encountered a customers sandbox where the standard "Save" and "Save & New" buttons have been replaced by a "Save & Add Brand" button on the standard new opportunity page. They have renamed Opportunity Line Items as Brands and have renamed the Products tab as such.

 

When pressed, the button saves the Opportunity (after validation of required fields etc...) and then redirects the user to a custom Visualforce page for entering the Brand details. The Visualforce Page they arrive on is configured as the override for Opportunity Product standard button AddProduct.

 

Salesforce New Opportunity Page with custom Save Button

 

How has the "Save & Add Brand" button been added to the New Opportunity page to replace the standard buttons?

 

I need to add some additional buttons but can't find where it has been configured.

 

Under Customize > Opportunities > Buttons and Links > Standard Buttons and Links New is not showing any override. Also, if I add ?nooveride=1 to the URL I get the same page with the custom button. Edit has been overridden but that Visualforce page isn't the one being displayed to new (as expected).

 

There is no Detail Page Button on Opportunity with a label corresponding to this button.

 

The same question appears on Stack Overflow.

Best Answer chosen by Admin (Salesforce Developers) 
zachelrathzachelrath

The ability to add Line Items / Products (or "Brands", in your case) when creating new Opportunities can be enabled/disabled by going to Opportunity Settings.

 

Go to "Setup > Customize > Opportunities > Settings" and uncheck "Prompt users to add products to opportunities"