You need to sign in to do that
Don't have an account?
BoolsEye
setBatchSize not working ?
Code:
I set setBatchSize to 5 but I always get all my Accounts with this code and 'done' is always true. I only have nearly 50 accounts in my database but does setBatchSize only has an effect on the query if there are more than that in the database ? I cannot find anything I'm doing wrong in this code. (I use AJAX toolkit 3.3 beta).
function runQuery() { sforceClient.setBatchSize(5); sforceClient.query("Select Id, Name From Account", queryCallBack, true); } function queryCallBack(qr) { if (qr.size > 0) { alert(qr.records.length); if (qr.done != true) { sforceClient.queryMore(qr.queryLocator, queryCallBack, true); } } }
I set setBatchSize to 5 but I always get all my Accounts with this code and 'done' is always true. I only have nearly 50 accounts in my database but does setBatchSize only has an effect on the query if there are more than that in the database ? I cannot find anything I'm doing wrong in this code. (I use AJAX toolkit 3.3 beta).
Thanks,
// Juergen
Ok, thank you. I found it in the API document.
I always thought that the value for batchSize is fixed if I set it.:smileyhappy:
// Juergen
Now, if only SFDC would let you retrieve more than 200 records at a time... :smileywink: