Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchAll returns no more than 5000 items #79

Closed
anthony-legay opened this issue Oct 28, 2020 · 8 comments
Closed

fetchAll returns no more than 5000 items #79

anthony-legay opened this issue Oct 28, 2020 · 8 comments
Assignees
Labels

Comments

@anthony-legay
Copy link

Hi everyone,

I'm facing a weird issue. The same fetchXml query returns more than 5000 items (5482 exactly) in one of our app in production (so it's ok) but when I do the same in a local console app, same version of the lib, same xml (copy paste), same configuration (apparently), it returns 5000, as if the paging info was not returned correctly.

I tried to add a log line to see if the response.PagingInfo was there but it's undefined in the console app.

I don't know where to search anymore. Anyone has an idea on this ?
Thanks !

@AleksandrRogov
Copy link
Owner

@Lebowskovitch can I ask you to try to send the same request manually and see if the paging cookie is in the response? You can catch the request details using Fiddler.
I need more information to figure out where the issue is.

@anthony-legay
Copy link
Author

anthony-legay commented Oct 29, 2020

@AleksandrRogov Ok so I tried to do the request manually with postman and I got the paging cookie, and 5000 items in the value, as expected.

"@Microsoft.Dynamics.CRM.fetchxmlpagingcookie": "<cookie pagenumber=\"2\" pagingcookie=\"%253ccookie%2520page%253d%25221%2522%253e%253cfullname%2520last%253d%2522Taryn%2520Kassulke%2522%2520first%253d%2522Aaliyah%2520Mann%2522%2520%252f%253e%253ccontactid%2520last%253d%2522%257b351E7841-0C19-EB11-A812-000D3AB36281%257d%2522%2520first%253d%2522%257bB8107841-0C19-EB11-A812-000D3AB36281%257d%2522%2520%252f%253e%253c%252fcookie%253e\" istracking=\"False\" />",
    "value": [
// ...

It's like the lib would behave differently in a terminal app.
FYI when we call the fetchAll method, we never use any additional params other than: the target entity, and the XML. (e.g. includeAnnotations or something). But until now, it always worked, and still works in production in our express app.

Edit: no worries for the names, it's fake data from faker-js :)

@AleksandrRogov
Copy link
Owner

@Lebowskovitch hi. I've ran tests and the PagingInfo object exists in the fetch response with the cookie you provided. Are you sure that the PagingInfo is null?

image

@anthony-legay
Copy link
Author

anthony-legay commented Nov 2, 2020

@AleksandrRogov Hi ! Here is an example of what I see on my side. I'm doing a fetchAll() request.
capture

As you can see, it seems the paging cookie is present in the response, but the PagingInfo is still undefined.

@anthony-legay
Copy link
Author

anthony-legay commented Nov 2, 2020

Ok, so I think I found the issue. I was using the web api with the useEntityNames parameter.
I just removed it (making it false ) and now its ok, the request returns more than 5000 items.

@AleksandrRogov
Copy link
Owner

@Lebowskovitch great! i will test the request with useEntityNames parameter. Maybe there's an issue with it somewhere.

@anthony-legay
Copy link
Author

I tried to investigate further but had to stop at some point. I think it has to do with the responseParams variable, which seems to lose the pageNumber property somewhere before the fetch request.

@AleksandrRogov
Copy link
Owner

ok thanks. I will check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants