Hide Recycle Bin from Home Page Layout : 2 Minute Recipe
Salesforce doesn't provide specifications to remove Recycle Bin from Home Page.But there are situations which demands that the Recycle Bin shouldn't be shown over the Home Page. In such adverse situations JavaScript is our Best Friend.
First Let me tell you about this Dustbin of Salesforce.
The Recycle Bin link in the sidebar lets you view and restore recently deleted records for 15 days before they are permanently deleted.You can read more from here.
Follow the following steps to Hide the Recycle Bin.
1. Click on Name > Setup > Customize > Home > Home Page Components.
2. Click on New to add a New Custom Component.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<span id="hideMyParentsp">
</span>
<script>
$(document).ready(function() { $('#sidebarDiv #hideMyParentsp').parent().parent().hide(); });
</script>
<script type="text/javascript">
window.onload = function(){
var x=document.getElementsByTagName("img");
for(var i=0;i<x.length;i++) {
if(x[i].title=='Recycle Bin') {
var dtag = x[i].parentNode.parentNode.parentNode; dtag.style.visibility='hidden';
}
}
var xx=document.getElementsByTagName("span");
for(var ii=0;ii<xx.length;ii++) {
if(xx[ii].innerHTML=='Recycle Bin') {
xx[ii].style.display='none';
}
}
};
</script>
</script>
<span id="hideMyParentsp">
</span>
<script>
$(document).ready(function() { $('#sidebarDiv #hideMyParentsp').parent().parent().hide(); });
</script>
<script type="text/javascript">
window.onload = function(){
var x=document.getElementsByTagName("img");
for(var i=0;i<x.length;i++) {
if(x[i].title=='Recycle Bin') {
var dtag = x[i].parentNode.parentNode.parentNode; dtag.style.visibility='hidden';
}
}
var xx=document.getElementsByTagName("span");
for(var ii=0;ii<xx.length;ii++) {
if(xx[ii].innerHTML=='Recycle Bin') {
xx[ii].style.display='none';
}
}
};
</script>
Click on Save.
3. Next we need to add this component on Home Page Layout.For this Follow the following Steps
Click on Name > Setup > Customize > Home > Home Page Layout.
Select "Edit" for your Layout from which you want to remove Recycle Bin.
Check the Component which you just created in Wide Column Display , Click Next
Click Save , Additionally you can see the preview.
You can see the changes in your Home Page. Recycle Bin is No More. You can say that his soul is with us [as it is just hidden] but his body left the mortal world.
I also lost my recycle bin the same way. write , comment me for some condolence at gautam.salesforce@gmail.com
Happy Hiding.
That worked for me.
ReplyDeleteI was looking for this from few days.
Great to hear that !! :-)
ReplyDeleteCongrats Gautam keep rocking. It's working fine. Thanks for your Innovation.
ReplyDelete