You need to sign in to do that
Don't have an account?
a problem I have since SOQL lacks ORDER BY
More concretely, here is what I am doing:
//get all Contact ids (for an Account, for example)
var queryString="Select ContactId From Account where AccountId = 'xBLAHBLAH'";
var queryResult=sforceClient.Query(queryString);
//code left out for brevity:
//get all results using queryResult = sforceClient.QueryMore(queryResult.queryLocator)
//while doing this use queryResult[i].get("ContactID") to store all contact ids in an array named ContactIds
//so at this point we have thousands of contact ids stored in an array named ContactIds
// Now what I want to do is have the data sorted, and then get only part of it, such as records 150 to 250, from 1000 total records.
// If SOQL had ORDER BY, the records would already be sorted, and I would make the following call, using a subset of ContactIds from index 150 to 250
// ie ContactIds.slice(150,250)
ContactRecords = sforceClient.Retrieve("Salutation, LastName, FirstName, AccountId, Email", "Contact", ContactIds.slice(150,250));
// But since SOQL does not have ORDER BY, I have to load every single record, sort them, and then pick out the subset of indexes 150 to 250.
// Loading thousands of records in order to sort them uses too much memory.
I hope that the problem is clear, and thanks for any help.
If there is no solution, then I'll just have to forget about sorting the data.
Message Edited by Nashorn on 12-02-2005 02:01 AM
Second, even with order by, you have to be cautious when using the AJAX toolkit for thousands of records. The browser is just not well suited for that kind of memory requirement.
Message Edited by adamg on 12-02-2005 09:11 AM
Is this true and is there a way for me to clear the memory I am using right after querying?