web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Getting Duplicate Pages When Using FetchXML to Search From CRM

(0) ShareShare
ReportReport
Posted on by

Hi CRM experts

 

I ran into a problem where we get duplicate records when search from the CRM using FetchXML.

 

We are performing the RetrieveMultiple operation, and making use of the page, count and paging-cookie to achieve pagination. It works fine when the records fit in the first page. But, when the records requires multiple pages, there will always be duplicate records being fetched, and the number of duplicate records is the same as the page size.

 

When I tried to look into the requests we send, looks like the duplication comes from the first page we fetched. Following is an example. There are 282 opportunity records in total for this search request, and I'm setting the page size as 100. I observed the following communication happens:

 

1. Request:

Response:

moreRecords=true,

nextPageCookie='<cookie page="1"><opportunityid last="{02853206-A3A1-E911-A97E-000D3A18CB47}" first="{8E7880AE-419B-EB11-B1AC-000D3A133FF1}" /></cookie>'

[….100 records from 8E7880AE-419B-EB11-B1AC-000D3A133FF1 to 02853206-A3A1-E911-A97E-000D3A18CB47

 

2. Request: 

">

Response:

moreRecords=true,

nextPageCookie='<cookie page="1"><opportunityid last="{02853206-A3A1-E911-A97E-000D3A18CB47}" first="{8E7880AE-419B-EB11-B1AC-000D3A133FF1}" /></cookie>'

[…100 records from 8E7880AE-419B-EB11-B1AC-000D3A133FF1 to 02853206-A3A1-E911-A97E-000D3A18CB47

 

3. Request: 

">

Response:

moreRecords=true,

nextPageCookie='<cookie page="2"><opportunityid last="{8D6F8E5B-D847-EA11-A812-000D3A1BB7BB}" first="{93D50E9D-99A5-E911-A97E-000D3A18CB47}" /></cookie>'

[…100 records from 93D50E9D-99A5-E911-A97E-000D3A18CB47 to 8D6F8E5B-D847-EA11-A812-000D3A1BB7BB

 

 

4. Request:

">

Response:

moreRecords=false,

nextPageCookie='<cookie page="3"><opportunityid last="{7AEA9762-FF89-E811-811E-C4346BAC4304}" first="{D09B2A19-5653-EA11-A812-000D3A1BB7BB}" /></cookie>'

[…82 records from D09B2A19-5653-EA11-A812-000D3A1BB7BB to 7AEA9762-FF89-E811-811E-C4346BAC4304

 

As I observed, the request for page 1 and page 2 are returning the same paging-cookie as well as the same 100 records, and thus causing this issue. To get around this, we have to discard the first page.

 

We are following the example mentioned here: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/org-service/page-large-result-sets-with-fetchxml , but I don't see the behavior above mentioned anywhere. This issue has been observed in our internal Dynamics CRM online sandbox, and we also have some customer complained about it who are using Dynamics CRM on premise.

 

I'm wondering if this is a bug in the CRM fetch XML api, or anything related to the CRM settings.

 

Can anyone suggest, please?

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 197 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans