Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Implement Min and Max 'Top' attributes for FetchXml and QueryExpression #537

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bwmodular
Copy link
Contributor

@bwmodular bwmodular commented Dec 13, 2020

Queries should prevent any requests where 'top' is less than 0 or more than 5000 with the exception:
Expected value between 0 and 5000 inclusive.

@bwmodular bwmodular changed the title Implement Min and Mx 'Top' attributes for FetchXml and QueryExpression Implement Min and Max 'Top' attributes for FetchXml and QueryExpression Dec 13, 2020
@jordimontana82
Copy link
Owner

This is an interesting one, does this limitation apply across all versions of Dynamics / CDS / Dataverse, Ben?

@jordimontana82 jordimontana82 added this to the v2.x milestone Dec 13, 2020
@bwmodular
Copy link
Contributor Author

HI @jordimontana82, I've not been able to find anything to suggest that this is not implemented across all versions, and I've tested in 2015 on-prem, 2016 on-prem and 365 online.
However, to be safe, in case it changes, or it is possible to overwrite the min and max at the database level, we could create 'MaxTopCount' property of the faked context, default it to 5000 but allow it to be set to a different value at run time?
We do already have a 'MaxRetrieveCount' property, which defaults to 5000, but this isn't used to restrict the 'Top' value in queries, only to restrict the number of records actually fetched. Could we/ should we use that?

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

Successfully merging this pull request may close these issues.

2 participants