[SalesForce] Remove buttons from Listview in VisualForce Page

I created this page and put it into an iframe on the Salesforce homepage. Is there anyway I can hide these buttons at the top? I have no problem with it being there except that when I click new case it loads a whole new page to create a case, within the Iframe. I would like to avoid this. If I could remove the buttons that would be great. The other option would be to load the whole page instead of just within the iFrame. Thoughts? Thanks!

<apex:page standardcontroller="Case" showHeader="false" sidebar="false" >
<div class="homeTab">
    <apex:ListViews type="Case" />
</div>
</apex:page>

Buttons

Best Answer

I'm assuming that you have a Visualforce page that uses the <apex:listViews> tag with the type of Case. For example:

<apex:page>
    <apex:listViews type="Case"/>
</apex:page>

You need to remove the buttons from the Search Layout for the Cases List View. Doing that will remove them from your Visualforce page if you used the <apex:listViews>.

  1. From the Setup menu go to the Cases Search Layout (Customize->Cases->Search Layout).

  2. Under the Case Search Layouts click the Edit link next to the Cases List View.

  3. On the Edit Search Layout for the Cases List View, uncheck the Standard Buttons that you do not want displayed and move the Custom Buttons that you don't want displayed from the Selected Buttons list to the Available Buttons list.

That will change the list view on the standard case tab as well, though. If that is not desired then you can use the apex:facet for the header of the apex:listViews component and just give it a blank space. (Note that if you just self close the facet or give it an empty body the buttons will still show up). For example:

<apex:page>
    <apex:listViews type="Case">
        <apex:facet name="header">&nbsp;</apex:facet>
    </apex:listViews>
</apex:page>
Related Topic