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
Josh HarshJosh Harsh 

Create Button that directs to the most Recent Item on side panel.

Hello,

I am looking to see if it is possible to create a Button on an object that when clicked it will direct to the most recent item in the recent items list in the side panel. Does anyone know if this is possible. Any help would be appreciated.

Thanks!
Chamil MadusankaChamil Madusanka
There is a new object available in Summer '13 called RecentlyViewed that you can use in SOQL to get a user's recently viewed records.
 
SELECT Id, Name FROM RecentlyViewed WHERE Type IN ('Account', 'Contact') ORDER BY LastViewedDate DESC

If you get the answer, please mark it as the correct answer. It will be a help to others who are facing the same problem later.