1K
How do get the Recently Viewed items using Soql Apex Class.
As per the new Summer ’13 Release salesforce introduced the new Standard Object called RecentlyViewed, so using that we can easily get the all the recently viewed items using apex class.
here is the Sample SOQL:
SELECT Id, Name, LastViewedDate FROM RecentlyViewed WHERE Type IN (‘Account’, ‘Contact’, ‘Case’) ORDER BY LastViewedDate DESC
Note:
The RecentlyViewed object does not support the Report, KnowledgeArticle, and Article objects.