0 Replies Latest reply on Nov 7, 2007 1:41 PM by cmarkiewicz

    capture when finished iterating over query results...

    cmarkiewicz
      Hello. I have a flex app that queries a web service. The code to iterate over the results is shown below. the query string is passed to the connection, and the results are processed inline.

      I want to know when i'm done iterating over the results. How do i do this? My current approach seems clumsy. I add an event listener to my connection for query complete. When that fires, I get the length of the result set. Then in my iterator, i have a condition that checks when the record count is equal to the length of the result set. i assume there's an easier/better way?

      queryResultIterator2 = new QueryResultIterator(wsconn, queryString,
      function (so:SObject):Boolean {
      productCodeAC.addItem(so.Product_Code__c);
      return true;
      }
      );

      thanks
      chris