+ Start a Discussion
Behzad Bahadori 18Behzad Bahadori 18 

Unable to access LastViewedDate on Account object SQL

I am trying to get the list of last 10 accounts viewed. The code seems to be working in sandbox and workbench but when I try deploying it in production, I get the error: No such column 'LastViewedDate' on entity 'Account'.

SELECT Id, Name, LastModifiedDate FROM account WHERE LastModifiedDate !=null ORDER BY LastViewedDate DESC limit 10

User-added image<apiVersion>31.0</apiVersion>
Hi Behzad,
Its a known issue, have a look at it here (https://success.salesforce.com/issues_view?id=a1p30000000T0tvAAC).

Fahad Akhtar
Behzad Bahadori 18Behzad Bahadori 18
but it says 27 and 28