function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
johndesantiagojohndesantiago 

Can't query object Id using API

When I am in Salesforce I can view a particular Task item which exists in a large list of other tasks, I think this one is 4 or 5 pages in. I grabbed the Id from the url and tried to query the Id and both the DataLoader and sforce Explorer return no results. I used the data loader to export all of the task records and it returned 50K + records. I imported the .csv into sql and tried to query the id there and still it came empty even using a like search on the id and on the Subject. I know that the Id's are case sensitive and have structured everything accordingly, the record is just not in the exported data set.

Does anyone know if there is a limit to how many records the API will read? I ask because I know that the Task object holds a ton of records. I don't know exactly how many or how to get that number except for exporting all the records and letting SQL count them but now I can't trust that number since records are missing.

Any help or suggestions would be greatly appreciated.

ScotScot

Is this an old task?  Assuming "yes", you're probably running into an archived task ... these are available for viewing, but not to the api.

From the API document ...

Sforce archives activities according to the following criteria:

    • Events with an ActivityDateTime or ActivityDate value greater than or equal to 365 days old
    • Tasks with a Closed flag value of True and an ActivityDate value greater than or equal to 365 days old
    • Tasks with a Closed flag value of True, a blank ActivityDate field, and a create date greater than or equal to 365 days ago
    johndesantiagojohndesantiago

    Thank you for your help. That is exactly what it was!