<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Record Count of a Feature Layer in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282224#M6721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good, can you tell me if I am in the right track and how to get the count value?&amp;nbsp; Would I just add &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureSet.features.length&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to the result function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Dec 2013 20:35:19 GMT</pubDate>
    <dc:creator>ionarawilson1</dc:creator>
    <dc:date>2013-12-20T20:35:19Z</dc:date>
    <item>
      <title>Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282217#M6714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am filtering a non-spatial feature service cast a feature layer. How can I get the record count after the search is complete? I know I can use&amp;nbsp; the length of feature layer graphic provider if the feature layer is an actual feature layer. But how can I the number of records for a non-spatial table (named yourTable)? How can I modify the last line of the code snippet in this case?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private function doSearch():void &amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.featureLayer = myFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var defexpr:String =&amp;nbsp; searchattribute +&amp;nbsp; eqsymbol +&amp;nbsp; "'"&amp;nbsp; +&amp;nbsp; qText.text&amp;nbsp; + "'";&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yourTable.definitionExpression = defexpr &amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.featureLayer = yourTable &amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(defexpr) &amp;nbsp;&amp;nbsp;&amp;nbsp; totalGraphicsShown = "Total records shown: " + (yourTable.graphicProvider as ArrayCollection).length &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 14:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282217#M6714</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-12-20T14:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282218#M6715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ionara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; The only way I know to make it work is to use the queryCount method to perform a query using the same SQL expression that you are setting for the defenitionExpression.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 14:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282218#M6715</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-12-20T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282219#M6716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please post a code snippet of an example of a querycount just for me to have an idea how to use it? thank you!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 14:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282219#M6716</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-12-20T14:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282220#M6717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ionara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I don't have a code example. It is just like any query you would do against a layer. Look at the documentation link I posted and you will see that it is identical to other queries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 14:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282220#M6717</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-12-20T14:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282221#M6718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I will try, Thank you!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 14:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282221#M6718</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-12-20T14:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282222#M6719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I might be in the right track. Can you please tell me how I get the count of features and what url I put in the query task since I am query a feature layer? Do I even need a query task since I am not executing it? Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 var query:Query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = defexpr
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; yourTable.queryCount(query, new AsyncResponder(onResult, onFault));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; function onResult(featureSet:FeatureSet,token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; function onFault(info:Object, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 


&amp;nbsp; &amp;lt;esri:QueryTask id="queryTask"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://tfsgis-iisd01:6080/arcgis/rest/services/SARS_WILSON/RELATED_TABLES/MapServer/1"/&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282222#M6719</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2021-12-11T13:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282223#M6720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ionara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; There is no need for a QueryTask and thus no need for a URL.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 19:21:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282223#M6720</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-12-20T19:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282224#M6721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good, can you tell me if I am in the right track and how to get the count value?&amp;nbsp; Would I just add &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureSet.features.length&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to the result function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 20:35:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282224#M6721</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-12-20T20:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282225#M6722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ionara,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Try this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function onResult(count:Number, token:Object):void
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(count);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282225#M6722</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T13:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282226#M6723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Robert. I will try this when I go back to the office on the 6th.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 12:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282226#M6723</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-12-26T12:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282227#M6724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried that but I get "null RECORDS", when I run the search&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp; private function doSearch():void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.featureLayer = myFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var defexpr:String =&amp;nbsp; searchattribute +&amp;nbsp; eqsymbol +&amp;nbsp; "'"&amp;nbsp; +&amp;nbsp; qText.text&amp;nbsp; + "'";
//&amp;nbsp;&amp;nbsp;&amp;nbsp; var defexpr:String =&amp;nbsp; searchattribute +&amp;nbsp; eqsymbol +&amp;nbsp; "'"&amp;nbsp; +&amp;nbsp; qText.text&amp;nbsp; + zerotime + "'";
&amp;nbsp;&amp;nbsp;&amp;nbsp; yourTable.definitionExpression = defexpr
&amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.featureLayer = yourTable
&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(defexpr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var query:Query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = defexpr
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; yourTable.queryCount(query, new AsyncResponder(onResult, onFault));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; function onResult(count:Number, token:Object):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var countstring:String
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countstring = count as String;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numberofrecords.text = countstring + " RECORDS" ;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; function onFault(info:Object, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

}
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And the mxml:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;mx:Text width="65" id="numberofrecords"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text="test"/&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:40:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282227#M6724</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2021-12-11T13:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Record Count of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282228#M6725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is what worked for&amp;nbsp; me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var defexpr6:String =&amp;nbsp; "DateComplete &amp;gt;= " +&amp;nbsp;&amp;nbsp; "'"&amp;nbsp; +&amp;nbsp; date1.text&amp;nbsp; + "'" + " AND DateComplete &amp;lt;= " + "'"&amp;nbsp; +&amp;nbsp; date2.text&amp;nbsp; + "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; var defexpr:String =&amp;nbsp; searchattribute +&amp;nbsp; eqsymbol +&amp;nbsp; "'"&amp;nbsp; +&amp;nbsp; qText.text&amp;nbsp; + zerotime + "'"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yourTable.definitionExpression = defexpr6 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.featureLayer = yourTable &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myAttributeTable.visible = true; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show(defexpr6) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = defexpr6; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds=[]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.executeForIds(query);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var objectIdsArray = []; &amp;nbsp;&amp;nbsp; function&amp;nbsp; executeForIdsOnResult(event:QueryEvent):void &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.removeEventListener(QueryEvent.EXECUTE_FOR_IDS_COMPLETE,executeForIdsOnResult); &amp;nbsp;&amp;nbsp;&amp;nbsp; objectIdsArray = event.objectIds; &amp;nbsp;&amp;nbsp;&amp;nbsp; numberofrecords.text = objectIdsArray.length.toString(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; } &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the mxml&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; &amp;lt;esri:QueryTask id="queryTask" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://tfsgis-iisd01:6080/arcgis/rest/services/SARS_WILSON/RELATED_TABLES/FeatureServer/1" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; executeForIdsComplete="executeForIdsOnResult(event)" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useAMF="false" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt; &amp;nbsp; &amp;lt;esri:Query id="query" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields=""&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnGeometry="false" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:Text width="65" id="numberofrecords" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text="test"/&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 19:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/record-count-of-a-feature-layer/m-p/282228#M6725</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2014-01-16T19:00:41Z</dc:date>
    </item>
  </channel>
</rss>

