I'm querying closed activities on a contact.
SELECT (SELECT Subject, ActivityDate, Description, IsTask, WhoId FROM ActivityHistories) FROM Contact WHERE Id = '003e000000EQ8fm'
The above query returns 8 closed activities (7 tasks and 1 event).
If I run the following query on Task:
SELECT t.Subject, t.Id, t.HQ_Activity__c FROM Task t WHERE t.WhoId = '003e000000EQ8fm'
I get 3 records returned (a small subset of the 8 records returned from the activity history)
So, if there a 7 closed tasks that are returned in the activity history query and only 3 task records returned from the Task query, what is the criteria that stops the records from being returned in the task query? They are all closed, yet 3 records still pull up when I query the Task object and not all 7. Why? What is the criteria that filters out those additional 4 records? Is it a date that is hard-wired into Salesforce that removes them from the Task object after a certain amount of time?