Use the RecentlyViewed table

Did you know you can query recently viewed records?

By running this simple query, you can get records that user recently viewed:

By running this simple query, you can get records that user recently viewed:

sql
SELECT Id, Name
FROM RecentlyViewed
WHERE Type IN ('Account', 'Contact', 'User')
ORDER BY LastViewedDate DESC

Why it is useful?

Using this simple query, you can build custom Recently Viewed lists:

Use the RecentlyViewed table — screenshot 2

Or use it as a search proposition in input components:

Use the RecentlyViewed table — screenshot 3

Text and code were extracted from the original slide. Plain-text version of the whole catalog