Loading

Get all records in the Task and Event objects.

Дата публикации: Oct 13, 2022
Описание
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. 

 
Решение
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 following links:

2. ALL ROWS is only intended for use in Apex SOQL queries. 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.
Querying All Records with a SOQL Statement


3. Salesforce Support can increase the archive period for your ORG, to retrieve more archived records. 
Номер статьи базы знаний

000386329

 
Загрузка
Salesforce Help | Article