CRM Software Logo

Microsoft Dynamics 365 & Dynamics CRM experts provide reviews and opinions to aid professionals with the Dynamics 365 selection process.

Hitachi Solutions America Bloggers

FetchXML 2011 -Total Record Count

Email | Print

Fetch in 2011 has added some really nice features.  One of those nice features is the total record count of the applied filter.  In 4.0 you had to execute two fetch statements, but now with 2011 you can add the ReturnTot alRecordCount attribute.

<fetch mapping='logical' count='25' returntotalrecordcount='true'>
   <entity name='account'>
      <attribute name='accountid' />
      <attribute name='accountnumber' />
      <attribute name='address1_city' />
      <attribute name='address1_telephone1' />
      <attribute name='name' />
      <order attribute='name' />
         <condition attribute='address1_city' operator='like' value='Greenville%' />


Upon executing this fetch statement with the ReturnTotalRecordCount  attribute set to true, the “TotalRecordCount” is returned.


Note: This is not the total number of entities, it is the total number of records that match the filter.

Post by: Paul Way, Customer Effective

One Response to “FetchXML 2011 -Total Record Count”

  1. James says:

    I need to get a record count in a similar way to this, i have the fetchXML but i dont know how to execute it and place it into a variable, can you help?


Show Buttons
Hide Buttons