locked
Endless Paging results from Query Expression (Many records with same Modified Date) RRS feed

  • Question

  • Hi all,

    I'm experiencing a weird issue regarding paging results via the XRM SDK (v5.0.17).
    The code I am using is very similar to the example code provided by Microsoft in the following article:

    The problem is that I have a CRM instance where the above code never finished paging through the list of Accounts.

    The cause seems to be related to the fact that a large portion (500+) of Accounts share exactly the same Modified Date (due to a previous Import).  While the PageInfo.Count (page size) I am using is set to 250. 
    (Unfortunately, extending this pagesize is not a viable option as I expect it could eventually exceed the maximum return packet).

    What happens is that all is fine paging the large result set until it reaches these imported Accounts, then the paging gets "stuck" re-returning the same page of results.

    I can kind of understand why this might be happening when I inspect the PageInfo.PagingCookie, as this specifies items such as the last Modified Date retrieved (below):

    <cookie page="5"><modifiedon last="2013-12-19T10:29:42-00:00" first="2013-12-19T10:29:42-00:00" /><accountid last="{41383BE5-DA03-E211-BC22-00505681000E}" first="{A915AF5B-4100-DF11-A0D2-000C2925A48B}" /></cookie>

    However, it also seems to also specify the last AccountID as well, which I would have thought would negate this issue.

    Would really appreciate anyone that has suggestions to overcome this issue (I'm probably doing something wrong!)

    Many thanks!


    • Edited by QG.Paul.N Thursday, December 19, 2013 12:08 PM Typo
    Thursday, December 19, 2013 11:50 AM