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>