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

  • 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.

    If you found another way than the suggestions answered, you could add it as an answer yourself, so that the question does not remain open.

    I have found a solution. Will post an answer soon.

    @anup: what solution you found, can you post it?

  • 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) {

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

    Well, we want them to create new opportunities but only via the "New Opportunity" button on the Opportunity related list on the Account or Contact page. It is more about streamlining process rather than restricting the act of creating opps. :)

    Yea, those are the situations we use javascript for: in case it would fail in the future, there is no service disturbance or risk of things really turning ugly.

    @Anup : I've added a js example.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM

Tags used