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' /> <filter> <condition attribute='address1_city' operator='like' value='Greenville%' /> </filter> </entity> </fetch>
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,
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?