Sunday, May 29, 2011

How to get the Total Results returned Record Count for a given query

In CRM2011 it is now possible to get the Total count of records returned by a query using Fetch XML.

Using Query expression:

You can set the ReturnTotalRecordCount property to True.



Using FetchXml:

You can set the same property as shown below.

<fetch mapping='logical' count='10' 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='a%' />
</filter>
</entity>
</fetch>

This can be helpful to show Record 1 of kind of status labels.

Hope this helps!

No comments:

Post a Comment