Quiero ocultar el botón 'Nuevo' en la página de Contactos

I trying to hide the 'New' button on Contacts page(https://na15.salesforce.com/003/o). I trying with the jQuery code:

<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://na15.salesforce.com/003/o";

alert('hello taburl is' +tabUrl);

if(url.indexOf(tabUrl) !== -1)


var newBtn = $j('[name="new"]');


I have pasted this code at Home Page Components. but, it didn't worked.

preguntado el 28 de mayo de 14 a las 11:05

That page requires authentication, I suggest you paste the relevant HTML here. -

@ICanHasKittenz There is no HTML file related to this script. Because, i'm writing this script on Contacts page of salesforce. However, you can check this at salesforce instance for more details. -

I was talking about the HTML tag containing the name nueva. Anyways, you do not seem to be calling the hideButton(); funcionar en cualquier lugar? -

2 Respuestas

You code seem fine. Two things to make sure: First custom sidebar components enabled on all pages. To do so go to :

Setup-> User Unterface -> Show Custom Sidebar Components on All Pages

Second make sure your layout is the right one (i.e. you added the component to the same layout which is set to your profile)

contestado el 29 de mayo de 14 a las 16:05

Please check whether the "newBtn" is undefined or it is having some value by using console.log(newBtn). You can also try using j('#new') if the button is having a unique ID

contestado el 28 de mayo de 14 a las 12:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.