How to determine if there are additional results?

Nov 26, 2013 at 4:39 PM
When i use a fetchXml statement which has a limited count attribute, how can i determine if there are additional results available?
Can i somehow get my hands on the resultXml to get the morerecords flag?
Or is there a more standard way to get this crucial info?
Jan 24, 2014 at 11:03 AM
Hey Loren.

In general, the result xml from soap request will include a parameter called "a\:MoreRecords". If this contains values, it will indicate there are more records for the retrieval.

You will need to search the resultXml for this if you want to retrieve all the records. You can have a look at the source code of XrmServiceToolkit.Soap.Fetch to have some ideas how the toolkit is allowed to do so.

Another way if you only care that the results are more than 5000 records, you can use an aggregate fetch xml to return the total number of records using Fetch.

Hope this helps.