0

Why salesforce does not show Recently Viewed List filter for Custom objects in Salesforce classic?

Is there anyway we can create list filter for Recently View records. I cannot find LastViewedDate while creating new View.

Please suggest on this.

1

You're correct in saying you can't create a list view for this. The recently viewed is not a list view, it's typically the home page for the tab. To get here simply click on the tab name on your tab bar or from the + menu (it's the page right before you click the go button):

enter image description here

Also, if you have your side panel open you can usually see a list of recently viewed records there; however, this is not object specific:

enter image description here

Lastly, if your custom object is searchable, you can see recently accessed records in the global search:

enter image description here

Update based on comments

If you have overridden the page, you'll want to get the recent records in your page controller and then add those to a list on your home page to reproduce the functionality.

Get Recent Records via SOQL

Example

SELECT Id, Name FROM RecentlyViewed WHERE Type ='Account'

You can also use ORDER BY LastViewedDate field to get latest records

SELECT Id, Name FROM RecentlyViewed WHERE Type ='Account' ORDER BY LastViewedDate DESC

I believe that an SObject Describe via the rest API returns a list of recent records as well.

Rest API Example

3
  • But I need to override custom object home tab. i have to add one more section below the recently viewed section. When i used <apex:enhancedlist> in the VF then i cannot see Recenly viewed section. Please provide suggestion for this.
    – SFDCcoder
    May 17 '18 at 11:33
  • @SFDCcoder You should update your question to explain that you have overridden the home page with a visualforce page so that people can provide you with answers that may actually help you.
    – gNerb
    May 17 '18 at 14:08
  • @SFDCcoder Updated my answer with more information for you.
    – gNerb
    May 17 '18 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.