USE ALL ROWS to get IsDeleted and IsArchived values
|Knowledge Article Number||000199524|
There are few ways you could get all the records in the TASK and EVENT object.
Salesforce archives activities (tasks and events) that are over a year old. You can use queryAll() to query on all TASK and EVENT records, archived or not. You can also filter on the isArchived field to find only the archived objects. You cannot use Query() as it automatically filters out all records where isArchived is set to true. You can update or delete archived records, though you cannot update the isArchived field.
|Resolution||1.) Use Workbench or use any tool and select the option include Deleted and Archived records,which could use queryAll() method. The queryAll() method needs a connection setup as it can only be used via an API call.
You can find more info about queryAll() API call in the below link: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_queryall.htm
2.) ALL ROWS is only intended for use in Apex SOQL queries. The documentation for ALL ROWS is in the Apex code documentation. The equivalent of ALL ROWS in the API is to call queryAll() instead of query(). You can't use that in Developer Console's Query Editor as the query editor doesn't execute it as Apex Code,it executes directly as a REST query API call.
3.) Salesforce Support can increase the archive period for your ORG, to retrieve more archived records.