You need to sign in to do that
Don't have an account?
Dogma
scripting toolkit
Hi
I'm using the scripting toolkit and I'm finding that it only exports 2000 records. How do I increase it so that it exports the whole table? And is it a good idea to export 900K records with it?
Cheers
function Results(queryResult) {
if (queryResult.size > 0) {
var output = "";
var records = queryResult.getArray("records");
for (var i=0;i<records.length;i++) {
var account = records[i];
output += account.Id + "," + account.Name + "\r\n";
}
WScript.echo(output);
}else WScript.echo("No records matched.");
ToolKit.Quit();
}
var callback = {onSuccess : Results, onFailure : function(e){WScript.echo(e)}};
var queryResult = sforce.connection.query("Select Id,Name from Account", callback);
if (queryResult.size > 0) {
var output = "";
var records = queryResult.getArray("records");
for (var i=0;i<records.length;i++) {
var account = records[i];
output += account.Id + "," + account.Name + "\r\n";
}
WScript.echo(output);
}else WScript.echo("No records matched.");
ToolKit.Quit();
}
var callback = {onSuccess : Results, onFailure : function(e){WScript.echo(e)}};
var queryResult = sforce.connection.query("Select Id,Name from Account", callback);
i've not tried this in the scripting toolkit, but if queryMore() is there it should work.
900K records will take a while, is this a one time, or part of a regular process?
Browsers may freeze or crash trying to load this much data into a single user experience. Should it load successfully, it's still scripted, which is up to five times slower than compiled native code, so they might be sitting around for a while waiting for it to load or call up portions of the data (admittedly, Flash is highly optimized, but it's still not native code). However, that will largely depend on the size of the user's cache, virtual memory, and physical memory.
Running smaller queries (ie. providing date filters and providing date navigation/range options) will give better performance on the Salesforce server, better performance on the client's computer, and be more responsive to user interaction. Plus, if the user doesn't need 900k records downloaded to see what they want to see, they'll have saved lots of bandwidth and processing power.
~ sfdcfox ~