Find your content:

Search form

You are here

Is it possible to remove/hide the "New" button?

 
Share

When you click on the Opportunities tab, (assuming you haven't modified standard salesforce layout), you see a "Recent Opportunities" list. At the top of the list, there is a "New" button.

enter image description here

Is there a way to hide the "New" button displayed on this page? I have tried disabling the button on the "Opportunity List View" Search Layout[Setup -> App Setup -> Opportunities -> Search Layouts], but it does not remove the button from this particular view.


Attribution to: Anup

Possible Suggestion/Solution #1

You can do that by Clicking Search layout on Opportunity, there you can add your custom button and can remove new button by unchecking the check box.

Thanks Puneet Mishra


Attribution to: user2630049

Possible Suggestion/Solution #2

Try this app - just came up on a call today! I believe this would allow what you are asking to do.

https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B4AJKEA3


Attribution to: jbinwilmington

Possible Suggestion/Solution #3

You can hide the new Button from Opportuinity using this javascript in the Homepage component in the sidebar of the home page and just copy this code in the custom home page component.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script>$j = jQuery.noConflict();$j(document).ready(function hideButton(){var url = window.location.href;var tabUrl = "https://cs13.salesforce.com/006/o";if(url.indexOf(tabUrl) !== -1){var newBtn = $j('[name="new"]');newBtn.css({"white-space":"normal","display":"none"});}});</script>

Attribution to: Kumar

Possible Suggestion/Solution #4

I like Sdry's answer a lot, but there were two issues with it that I wanted to address:

  1. I don't want to include jQuery in a home page component.
  2. It doesn't work when the script runs before the element you are trying to hide is added to the dom. It really needs to be ran onDomReady.

So, after a bit of tinkering and finding out about Sfdc.onReady I came up with the following solution:

<script>
  Sfdc.onReady(function() {
    var keyPrefix = 'a7m';
    var toRemove = document.getElementsByName('new');
    if(document.location.href.indexOf('/' + keyPrefix + '/o') != -1 && toRemove && toRemove.length) {
      toRemove[0].style.display = 'none';
    }
  });
</script>

Attribution to: Phil Rymek

Possible Suggestion/Solution #5

As per Summer 15 release this feature will break the functionality. Have a look at the following post. Javascript sidebar workaround Follow the steps mentioned in the post and upload a static resource file containing the following old school style javascript code. That should do the trick.

document.addEventListener('DOMContentLoaded', function () {
var url = window.location.href;
var tabUrl = "https://cs5.salesforce.com/006/o";
if(url.indexOf(tabUrl) !== -1){
    var x = document.getElementsByName("new");
    var i;
    var newBtn;
    for (i = 0; i < x.length; i++) {
        if (x[i].type == "button") {
            newBtn = x[i];
        }
    }
    newBtn.style.display = 'none';
}});

Attribution to: user2454242

Possible Suggestion/Solution #6

We use homepage components which analyse the page, and use javascript to remove/add buttons where we have no other choice to do so. But this implies developing with a high dependency on the salesforce html output .. which is not guaranteed to stay unchanged, this is something to strongly consider if you would explore this approach.

Why do you want to remove the new button ? If there are groups of users who should not make opportunities, you may want to restrict them access through their profile.

update: For instance, using jquery:

if (document.location.href.toString().indexOf("/a49/o") != -1) {
        $('input[name=new]').hide(); 
 }

You would need to update the Id when migrating code between sandboxes/organisations.


Attribution to: Samuel De Rycke

Possible Suggestion/Solution #7

You can override the standard functionality of the 'New' button within the Button and Links section. Otherwise if memory severs correctly, if a person does not have access to create opportunities it will not display either


Attribution to: Double A

Possible Suggestion/Solution #8

One sort of clunky workaround is to override the "New" function on the Opportunity object to redirect to a page that simply says, "Please create Opportunities from the Account Page" or something like that. This is probably the simplest way to keep them from using the standard New button, and just using your custom button on the Account Page.


Attribution to: Jeremy Nottingham

Possible Suggestion/Solution #9

The new button is display if the User viewing the page has the create permission set in their profile for the object you are looking at.

Therefore I think that the only work around for this is to override the New button. SFDC documentation for how to do that is below

https://na5.salesforce.com/help/doc/en/links_customize_override.htm


Attribution to: Owen Davies
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1308

My Block Status

My Block Content