Skip to content

Delete Unused List Views in Salesforce

Clean Salesforce org is a key for successful implementation. You know the pain when you’ve created so many list views.

Recently one of my clients had the same issue; let me show you how I handled it. It is pretty simple to identify how to find and delete such list views.

Before going ahead, if you haven’t read my previous articles, please do so now. It will help you shape your Salesforce skills with the latest release features.

  1. Create Dynamic Forms in Salesforce with Clicks
  2. How to Set Assignment Expiration on Permission Sets and Permission Set Groups

Use Case

Andy is working as a Salesforce Administrator at Appiuss Softwares. His VP of Client Success has to identify the Case list views which he is not Viewed in the last 60 days.

Pre-requisite

Before going ahead, let’s take a minute pause here to understand the ListView object. It represents a list view. A list view specifies a set of records for an object, based on specific criteria.

Solution

  1. Run the following through VP of Client user’s account.
  2. Click on Setup | Developer Console
  3. Navigate to Query Grid and select Query Editor
  4. Run the following query
  5. select id, name , LastReferencedDate, LastViewedDate, SobjectType from listview where LastViewedDate!=LAST_N_DAYS:60 and SobjectType='Case'
  6. You have the list view Ids. Have a meeting with your VP of Client Sucess and decide if you want to delete or keep it.

You are Done!!!

I would love to hear about your experience with Unused List View deletion. How do you work on unused list views?

4 thoughts on “Delete Unused List Views in Salesforce”

  1. I wish this could be this simple. But, unfortunately it’s not.

    Lastviewieddate is a ‘logged in user’ specific field. In your use case, if a admin run this query, he/she will see the listviews whichever viewed by him/her.

    So, you can’t find all the listviews viewed by ALL users. Not possible. Please check, i am curious to know if there’s a solution for this.

Leave a Reply

%d bloggers like this: