In order to drive data quality and usability it is sometimes helpful to show items from the ‘Recently Viewed’ table or straight from the object using the ‘LastViewedDate’ or ‘LastReferencedDate’. When accessing items from List Views, Reports, or Search the recently viewed fields are updated automatically (duh right?). When accessing a record from a custom visualforce page (at least how I create them) the recently viewed data is not updated. After searching the interwebs I didn’t see this issue readily but after a these two links:
FOR REFERENCE: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_for_reference.htm
So basically tag ‘FOR VIEW’ at the end of your SOQL and you’re good to go!
Here’s an account example: SELECT Id, Name FROM Account WHERE LastViewedDate !=null ORDER BY LastViewedDate DESC limit 10