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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Paging cookie bug

(0) ShareShare
ReportReport
Posted on by 155

According to this article there is a serious bug in how the paging cookie is managed in Microsoft CRM. In short, the bug appears when trying to retrieve more than 5000 records in a one-to-many relationship. The author states that that since the parent entity does not contain a unique guid, the paging cookie will also not be unqiue, which might lead to that there are plenty of records that will go missing when retriving the next page of records.

Has anyone experienced this bug? How did you get around it?

One way is of course to turn the query around to use the child entity as the primary entity. In this way every record will be unique. But this is not an optimal solution either since I have to manually change it back in code.

Another way that I have noticed is that when i´m specifying the order on the child entity like this: 

linkedEntity.Orders.Add(attribute, OrderType.Ascending)

then the paging cookie will always be empty. This removes the problem that records go missing, but as I understand, this leads to a lot of overhead in SQL.

The best way would of course be if there is any way to make the paging cookie contain both the parent and child record. But I have not found any way yet to do that. Any idea?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi kranis,

    You're absolutely right about this bug and it's root cause, and the potential steps to mitigate it. I came across the same thing and spent the last two days trying to figure out what was going on with it. I'm talking with Microsoft about it to see if they intend to fix it, but my guess is that you need to use one of the other approaches (skipping paging is fastest, re-writing your query is best).

    Hope this helps,

     Aiden

  • kranis Profile Picture
    155 on at

    Thanks for the answer. Update me when you have more info!

    //Christer

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi again,

    There's no fix but at least Microsoft updated their documentation to say this is a case where you shouldn't use paging cookies:

    https://github.com/MicrosoftDocs/dynamics-365-customer-engagement/blob/323d69c97895ced16ab72b06fe5614e098901698/ce/developer/org-service/page-large-result-sets-with-fetchxml.md#when-not-to-use-paging-cookies

    Thanks,

      Aiden

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans