function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dominic Sebastian 7Dominic Sebastian 7 

hide the recycle bin in salesforce for the 2015 edition

 Is there a way to hide the recycle bin from the home page component tab?. For the 2015 edition of salesforce as the HTML area for the javascript code is not working

<script>

 var sfdcOnload = self.onload;

 self.onload = function() {

      if (sfdcOnload) sfdcOnload();

      // - hide copyright

     var elements = getElementsByClassName('bPageFooter noTableFooter');
    if (elements.length>0) {
        elements[0].innerHTML = "Your own copyright battle cry";
        elements[0].style.display = 'none'; // or this if you just don't want to see it
    }

 }

</script> 
 
Best Answer chosen by Dominic Sebastian 7
Anirudh SinghAnirudh Singh
Hello Dominic,

This is possible using Javascript and some configuration. Please follow the below steps:

1. Go to Setup--> Customize--> Home--> Custom Links.

2. Click 'New' button.
Give Label as 'Hide Recycle Bin' and Name as 'Hide_Recycle_Bin'.
Behavior as 'Execute JavaScript' and Content Source as 'OnClick JavaScript'.
Then, put the following in the below input area:
{!REQUIRESCRIPT('/resource/' & LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(NOW()),':',''),'-',''),' ',''),14) & '000/HideRecycleBin_JS')}
Click 'Save'.

3. Go to 'Home Page Components'.
In 'Custom Components' section, click 'New' button.
Name='Hide Recycle Bin', Type='Links'. Click 'Next'.
Now, add 'Hide_Recycle_Bin' from 'Custom Links not to show' to 'Custom Links to show'.
Click 'Save'.

4. Go to 'Home Page Layouts'.
Click 'Edit' button in front of the layouts one by one and Edit all the layouts and check the checkbox for 'Hide Recycle Bin'. Click 'Next'.
In the 'Order the components', make sure the 'Hide Recycle Bin' is present in the 'Narrow (Left) Column'.
Click 'Save'.

Note: Add 'Hide Recycle Bin' to only those layouts for which you have to hide the 'Recycle Bin'.

5. Go to 'Customize'--> 'User Interface'--> Under 'Sidebar' section--> Check 'Show Custom Sidebar Components on All Pages'.
Click 'Save'.

6. Now, open Developer console.
Click 'File'--> 'New'--> 'Static Resource'--> 'Name' as 'HideRecycleBin_JS' and 'Mime Type' as 'application/javascript'.
Replace the code generated from the below code:
Sfdc.onReady(
    function()
    {
        var sidebarComponents=document.getElementsByClassName("brandPrimaryFgr");
        for(var i=0; i<sidebarComponents.length; i++)
        {
            if(sidebarComponents[i].innerHTML.indexOf('Hide Recycle Bin')>-1)
            {
                sidebarComponents[i].parentElement.parentElement.style.display='none';
            }
        }
        var recycleBinElement=document.getElementsByClassName("recycleText");
        for(var i=0; i<recycleBinElement.length; i++)
        {
            if(recycleBinElement[i].innerHTML.indexOf('Recycle Bin')>-1)
            {
                recycleBinElement[i].parentElement.parentElement.parentElement.style.display='none';
            }
        }
    }
);

Your 'Recycle Bin' is hidden now.

Please let me know if this helps.
Also, please mark the Question as solved if this reply solves your issue.

Thanks and Regards,
Anirudh Singh

All Answers

James LoghryJames Loghry
Just save your headaches and don't do this.  Don't. 
Andy BoettcherAndy Boettcher
Sidebar HTML/JS components are no longer supported - you cannot hide the recycle bin.
Dominic Sebastian 7Dominic Sebastian 7
Is there a way to use VisualForce Area to do this ?.
Andy BoettcherAndy Boettcher
Nope - VF loads in a manner where you can't come back and manipulate the parent container.
Dominic Sebastian 7Dominic Sebastian 7
Is there a work around to not allow permission to the recycle bin with the professional edition of salesforce ?.
Andy BoettcherAndy Boettcher
Unfortunately not.  If you users have read access to the files they've deleted, they can see them in the Recycle Bin.

https://help.salesforce.com/HTViewHelpDoc?id=home_delete.htm&language=en_US
Anirudh SinghAnirudh Singh
Hello Dominic,

This is possible using Javascript and some configuration. Please follow the below steps:

1. Go to Setup--> Customize--> Home--> Custom Links.

2. Click 'New' button.
Give Label as 'Hide Recycle Bin' and Name as 'Hide_Recycle_Bin'.
Behavior as 'Execute JavaScript' and Content Source as 'OnClick JavaScript'.
Then, put the following in the below input area:
{!REQUIRESCRIPT('/resource/' & LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(NOW()),':',''),'-',''),' ',''),14) & '000/HideRecycleBin_JS')}
Click 'Save'.

3. Go to 'Home Page Components'.
In 'Custom Components' section, click 'New' button.
Name='Hide Recycle Bin', Type='Links'. Click 'Next'.
Now, add 'Hide_Recycle_Bin' from 'Custom Links not to show' to 'Custom Links to show'.
Click 'Save'.

4. Go to 'Home Page Layouts'.
Click 'Edit' button in front of the layouts one by one and Edit all the layouts and check the checkbox for 'Hide Recycle Bin'. Click 'Next'.
In the 'Order the components', make sure the 'Hide Recycle Bin' is present in the 'Narrow (Left) Column'.
Click 'Save'.

Note: Add 'Hide Recycle Bin' to only those layouts for which you have to hide the 'Recycle Bin'.

5. Go to 'Customize'--> 'User Interface'--> Under 'Sidebar' section--> Check 'Show Custom Sidebar Components on All Pages'.
Click 'Save'.

6. Now, open Developer console.
Click 'File'--> 'New'--> 'Static Resource'--> 'Name' as 'HideRecycleBin_JS' and 'Mime Type' as 'application/javascript'.
Replace the code generated from the below code:
Sfdc.onReady(
    function()
    {
        var sidebarComponents=document.getElementsByClassName("brandPrimaryFgr");
        for(var i=0; i<sidebarComponents.length; i++)
        {
            if(sidebarComponents[i].innerHTML.indexOf('Hide Recycle Bin')>-1)
            {
                sidebarComponents[i].parentElement.parentElement.style.display='none';
            }
        }
        var recycleBinElement=document.getElementsByClassName("recycleText");
        for(var i=0; i<recycleBinElement.length; i++)
        {
            if(recycleBinElement[i].innerHTML.indexOf('Recycle Bin')>-1)
            {
                recycleBinElement[i].parentElement.parentElement.parentElement.style.display='none';
            }
        }
    }
);

Your 'Recycle Bin' is hidden now.

Please let me know if this helps.
Also, please mark the Question as solved if this reply solves your issue.

Thanks and Regards,
Anirudh Singh
This was selected as the best answer
Andy BoettcherAndy Boettcher
Please, please, please - keep in mind that technical hacks and workarounds are just that - hacks and workarounds.  Do they work right now?  Sure they do (I'm not minimizing Anirudh Singh's answer) - but what about when the new LightningUI hits?  What about a future release that changes the DOM?  What about when they close the loophole you selected as best answer?  Just a bad choice to hide functionality through DOM hacks, that's all I'm saying.  Train the users to use the tool.