You need to sign in to do that
Don't have an account?
bssantosh
Querying large number of records
Hi,
I need to fetch 200+ Campaigns and the NumberOfLeads and NumberOfContacts associated with them satisfying a particular condition (like only those members to be counted with a particular status). I dont know if I can use a join to do this (as the Status info is in the Members table).
What would be the best and fast way of doing this? The Member count can be 100000+!
Thanks.
What I do first is get the ownerId and contactId for the cases that fit my criteria.
Code:
I then push those Id's into an array (using querymore if the results are more than 200). I then use that array to build my dataset of other stuff I need from other objects. For instance, I'll use the ContactIds to get information from Contact, and then the AccountIds (from the Contact object) to get data from Account. I'll also use CreatedById to retrieve information from the User object.
Seems like a pain (and it is) but it's the best way I've found to get large amounts of data from different objects without the ability to do joins. If anyone else knows a better way, let me know.