You need to sign in to do that
Don't have an account?
Tom Politowski
Batch query on EmailMessage object times out
Batch Apex query on EmailMessage times out. Only 1M records in database. Query from Developer Console times out at 'LIMIT 10000'. Other queries on other objects with large 1M+ records work without issue.
Code:
String query = 'SELECT Id FROM EmailMessage';
global Database.querylocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);
}
How can I create query to return all records? Tried adding 'WHERE IsDeleted = false' - still times out.
Code:
String query = 'SELECT Id FROM EmailMessage';
global Database.querylocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);
}
How can I create query to return all records? Tried adding 'WHERE IsDeleted = false' - still times out.
Instead of using a normal Query, I suggest you create a Bulk Query. It's another Operation which is used for processing a large number of records.
Please let us know still if you are facing the issue.
Thanks,
Nagendra.
May I request you to please refer the below link for reference.
- https://success.salesforce.com/issues_view?id=a1p3A000000jkuEQAQ
I hope it will be helpful.Best Regards
Rahul Kumar
Rahul, we do not do any sub-queries.
Why does the GetQueryLocator with no filtering timeout on EmailMessage - it works fine on other large recordsets?