Quiero ocultar el botón 'Nuevo' en la página de Contactos
Frecuentes
Visto 987 equipos
2
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"]');
newBtn.css({"white-space":"normal","display":"none"});
}
});
</script>
I have pasted this code at Home Page Components. but, it didn't worked.
2 Respuestas
1
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
0
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 jquery salesforce or haz tu propia pregunta.
That page requires authentication, I suggest you paste the relevant HTML here. - AyB
@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. - Rv1
I was talking about the HTML tag containing the
name
nueva. Anyways, you do not seem to be calling thehideButton();
funcionar en cualquier lugar? - AyB