Packagecom.salesforce
Classpublic class QueryResultIterator

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 );



Public Properties
 PropertyDefined by
  soql : String
QueryResultIterator
Public Methods
 MethodDefined by
  
QueryResultIterator(apexConnection:Connection, soql:String = "", forEachSobject:Function = null)
QueryResultIterator
  
forEach(forEachSobject:Function):void
QueryResultIterator
  
lastSobject():Boolean
QueryResultIterator
  
QueryResultIterator
Property detail
soqlproperty
soql:String  [read-write]Implementation
    public function get soql():String
    public function set soql(value:String):void
Constructor detail
QueryResultIterator()constructor
public function QueryResultIterator(apexConnection:Connection, soql:String = "", forEachSobject:Function = null)Parameters
apexConnection:Connection
 
soql:String (default = "")
 
forEachSobject:Function (default = null)
Method detail
forEach()method
public function forEach(forEachSobject:Function):voidParameters
forEachSobject:Function
lastSobject()method 
public function lastSobject():Boolean

Returns
Boolean
queryResult()method 
public function queryResult():QueryResult

Returns
QueryResult