You need to sign in to do that
Don't have an account?
Leah Schneider
SOQL Query returns no results
I had a more complicated SOQL query that was only returning partial results. I've since refined it looking to get to the bottom of the issue and I'm stuck in that I can't find a record that I know exists.
The SOQL Query: SELECT Id FROM Task WHERE Id = '00TU00000031qJT'
This query returns nothing.
The record page:
A task with that Id definitely exists.
The SOQL Query: SELECT Id FROM Task WHERE Id = '00TU00000031qJT'
This query returns nothing.
The record page:
A task with that Id definitely exists.
Task myTask = [SELECT Id FROM Task WHERE Id = '00TU00000031qJT' ALL ROWS];
system.debug('task id ' + myTask.id);
Is your task archived (older than 365 days)?
Regards
All Answers
Task myTask = [SELECT Id FROM Task WHERE Id = '00TU00000031qJT' ALL ROWS];
system.debug('task id ' + myTask.id);
Is your task archived (older than 365 days)?
Regards
It's much older than 365 days. It's from 2008. Last updated in 2013. However I have tasks from 2012 (last updated 2012) that I can see. Is there a way to see if tasks are archived and work around this?
I'm trying to copy the "view all activities" functionality in Salesforce Classic in Lightning.
How to increase your Archive Days limit
Change the Archive Days limit by creating a case with Salesforce Customer Support
https://help.salesforce.com/articleView?id=Increasing-Archive-Days-for-your-Organization&language=en_US&type=1
Regards.