You need to sign in to do that
Don't have an account?

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
<apiVersion>31.0</apiVersion>
SELECT Id, Name, LastModifiedDate FROM account WHERE LastModifiedDate !=null ORDER BY LastViewedDate DESC limit 10
Its a known issue, have a look at it here (https://success.salesforce.com/issues_view?id=a1p30000000T0tvAAC).
Thanks,
Fahad Akhtar