I have a visual force page that is overriding the edit and view actions on the Task object (as described here). This works great until we encounter a task that has been archived. When you try to edit or view the task you get an error saying:
Data Not Available The data you were trying to access could not be found. It may be due to another user deleting the data or a system error.
If I open up the log, its easy to see that the error is happening because the query to get the record type, doesn’t include the ALL ROWS clause.
select RecordTypeId, RecordType.DeveloperName from Task where Id = 'MYID' limit 1
Return no record
select RecordTypeId, RecordType.DeveloperName from Task where Id = 'MYID' ALL ROWS