fake-xrm-easy icon indicating copy to clipboard operation
fake-xrm-easy copied to clipboard

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

Open bwmodular opened this issue 3 years ago • 2 comments

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 avatar Dec 13 '20 12:12 bwmodular

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

jordimontana82 avatar Dec 13 '20 21:12 jordimontana82

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?

bwmodular avatar Dec 14 '20 11:12 bwmodular