Answered by:
# of records returned by RetrieveMultiple

Question
-
I have read some thread that says RetrieveMultiple will give total count of records. However it seems to be not true for my case. I am calling CRM 2011 webs service through WCF service. There are >5000 records in CRM. But RetrieveMultiple only returns 4992 records. Some records are not in the returned record list. The goal is just get all the records. So there is no filter used.
The same issue also occurs in our application that use CRM 4.0 webs service.
It seems to me that it's related to some buffer/response size. But not sure where to look at.
Does anyone know what might be the problem? is there a way to tell webs service to return all records?
Thanks in advance!
- Edited by Vicky922 Monday, September 12, 2011 5:57 PM
Monday, September 12, 2011 5:54 PM
Answers
-
Ok, now I understand. You have to implement this pattern:
http://ronaldlemmen.blogspot.com/2006/08/fetch-all-records.html
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Monday, September 12, 2011 6:44 PM
- Marked as answer by Vicky922 Monday, September 12, 2011 10:27 PM
Monday, September 12, 2011 6:44 PMModerator
All replies
-
To get the actual count you should use retrievemultiple with FetchXML aggregation to retrieve the data. Here is a post that is doing pretty much exactly what you need.
http://mileyja.blogspot.com/2011/06/getting-row-count-or-entity-count-in.html
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Monday, September 12, 2011 6:01 PM
Monday, September 12, 2011 6:01 PMModerator -
Thanks for your information!
However, what I need is not just getting total count, but to get all the records with a few attributes. And check if data being processed already exits in the list. If not, create a new one. The data being processed can be a few hundred or thousand. So that's why I want to get all existing records in CRM at once, instead of cal web service to check each data individually.
Is there a way to get all records at once?
Thanks.
Monday, September 12, 2011 6:24 PM -
Ok, now I understand. You have to implement this pattern:
http://ronaldlemmen.blogspot.com/2006/08/fetch-all-records.html
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Monday, September 12, 2011 6:44 PM
- Marked as answer by Vicky922 Monday, September 12, 2011 10:27 PM
Monday, September 12, 2011 6:44 PMModerator -
That's very helpful. Thanks a lot!Monday, September 12, 2011 6:57 PM
-
If that answered the question you should come back and marked my proposed replies as the answer to the question and also mark them helpful. That way I get points for helping you.
Thanks!
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Monday, September 12, 2011 7:07 PMModerator -
Just wanted to make sure awareness of the AggregateQueryRecordLimit setting is out here as well, and the following two paging tactics are being used:
http://msdn.microsoft.com/en-us/library/gg327917.aspx
http://msdn.microsoft.com/en-us/library/gg309717.aspx
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful. Michael Mayo
Wednesday, December 18, 2013 9:33 PM