I noticed when I load a record for an object that has its View overridden with a Visualforce page, it does not put this record into the "Recently Viewed" list.

Is there any way to put this record into the Recently Viewed list?

  • 1
    Have you tried querying it in the constructor "for view"? I guess that might be impractical to have to do on every page, but a workaround nevertheless.
    – sfdcfox
    Oct 28, 2015 at 1:54
  • That was what I was looking for! Please make it an answer and I'll accept it, thanks!
    – Ray Dehler
    Oct 28, 2015 at 19:13

2 Answers 2


Querying the record "for view" will cause it to appear on the recent items list. You can do this in the constructor for the Visualforce page. Here's an example:

public MyPageController(ApexPages.StandardController controller) {
    SObject[] record = [SELECT Id FROM Account WHERE Id = :controller.getId() FOR VIEW];

In addition to the answer from sfdcfox, if you have a tab created for the object, it will show in the recent items list even without requiring FOR VIEW.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .