Simple interface to combine query() and queryMore() when traversing large query return sets.
Uses an event to wait for each subsequent queryMore() call to complete. Calls the provided function once with each
sobject from the query result set.
The provided function should return true to continue processing or false to quit the looping.
The forEach function can be provided in the constructor or by calling object.forEach() and passing the
reference to the function that should be used.
Example
var d:QueryResultIterator = new QueryResultIterator(conn, "select id , name from Account");
d.forEach( function (so:SObject):Boolean {
output.text += so.Name + '\n';
return true;
} );
d = new QueryResultIterator(c);
d.soql = "select id , name from Account";
d.forEach( function );
soql:String [read-write]Implementation
public function get soql():String
public function set soql(value:String):void
public function QueryResultIterator(apexConnection:Connection, soql:String = "", forEachSobject:Function = null)Parameters
| apexConnection:Connection |
| |
| soql:String (default = "") |
| |
| forEachSobject:Function (default = null) |
public function forEach(forEachSobject:Function):voidParameters
public function lastSobject():Boolean
Returns
public function queryResult():QueryResult
Returns