Skip to content

Commit 7ceda46

Browse files
authored
Live publish
2 parents 5fd9344 + 11513b9 commit 7ceda46

File tree

5 files changed

+102
-2
lines changed

5 files changed

+102
-2
lines changed

powerapps-docs/developer/common-data-service/TOC.yml

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
href: org-service/paging-behaviors-and-ordering.md
3232
- name: Use column comparison in queries
3333
href: column-comparison.md
34+
- name: FetchXML search item limit
35+
href: quick-find-limit.md
3436
- name: "Use SQL to query data (Preview)"
3537
href: cds-sql-query.md
3638
- name: Saved Queries

powerapps-docs/developer/common-data-service/org-service/entity-operations-query-data.md

+2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ results.Entities.ToList().ForEach(x => {
9797
9898

9999
More information:
100+
100101
- [Use FetchXML to construct a query](../use-fetchxml-construct-query.md)
101102
- [FetchXML schema](../fetchxml-schema.md)
103+
- [Work with Quick Find’s search item limit](../quick-find-limit.md)
102104
- [Page large result sets with FetchXML](page-large-result-sets-with-fetchxml.md)
103105
- [Use FetchXML aggregation](../use-fetchxml-aggregation.md)
104106
- [Fiscal date and older than datetime query operators in FetchXML](../use-fetchxml-fiscal-date-older-datetime-query-operators.md)

powerapps-docs/developer/common-data-service/query-hierarchical-data.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ You can take advantage of new query condition operators to query entities with e
5959
```
6060

6161
> [!NOTE]
62-
> The aggregate value returned represents all the child records, including any that the user may not have access to read.
62+
> The aggregate value returned represents all the child records, including any that the user may not have access to read.
6363
64-
64+
### See Also
65+
66+
[Work with Quick Find’s search item limit](quick-find-limit.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: "Work with Quick Find’s search item limit (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3+
description: " " # 115-145 characters including spaces. This abstract displays in the search result.
4+
ms.custom: ""
5+
ms.date: 08/18/2020
6+
ms.reviewer: "pehecke"
7+
ms.service: powerapps
8+
ms.topic: "article"
9+
author: "NHelgren" # GitHub ID
10+
ms.author: "nhelgren" # MSFT alias of Microsoft employees only
11+
manager: "jday" # MSFT alias of manager or PM counterpart
12+
search.audienceType:
13+
- developer
14+
search.app:
15+
- PowerApps
16+
- D365CE
17+
---
18+
19+
# Work with Quick Find’s search item limit
20+
21+
Quick Find provides an easy way to configure the default search experience
22+
across Dynamics 365 Customer Engagement or Common Data Service entities. Quick Find provides optimized searching across multiple fields in a single query. When using Quick Find, the data service may return an error during a
23+
query indicating:
24+
25+
*The number of records for this search exceeds the Quick Search record limit.*
26+
27+
This error occurs because the query received too many results and has been stopped to prevent the data service's resource consumption from causing potential outages. This article will explain how the 10,000 search item limit is calculated and includes best practices to avoid hitting this limit.
28+
29+
> [!NOTE]
30+
> A Quick Find is a FetchXML query that contains one of these filter attributes: `isquickfindquery`, `isquickfindfields`.
31+
32+
## How the search item limit is calculated
33+
34+
Quick Find queries use a two-stage execution. The first stage uses the Quick
35+
Find filters and the provided search string to gather the records before applying
36+
additional filters. The query engine enforces the 10,000 record limit during this stage.
37+
38+
The second stage uses the result set from the first stage and runs any remaining
39+
filters, for example: related record or security filters.
40+
41+
Consider the following FetchXML Quick Find query:
42+
43+
```xml
44+
<fetch version='1.0' output-format='xml-platform' mapping='logical'>
45+
<entity name='account'>
46+
<attribute name='name' />
47+
<filter type='or' isquickfindfields='1' overridequickfindrecordlimitenabled='1'>
48+
<condition attribute='name' operator='like' value='%A%' />
49+
</filter>
50+
<filter type='and'>
51+
<condition attribute='statecode' operator='eq' value='0'/>
52+
</filter>
53+
</entity>
54+
</fetch>
55+
```
56+
57+
The query engine will execute the condition on “name” first. Since the search is
58+
using wild cards with a short search string, the query will hit the 10k limit
59+
before running any other filters. It is important to note that even if the
60+
result set after the second stage (when applying a state code value) would have
61+
filtered down to less than 10k records, the query engine will hit the exception
62+
in the first stage and not progress to stage two.
63+
64+
## When the search limit does not apply to Quick Find queries
65+
66+
The query engine treats Quick Find queries with 1 or zero search columns as a
67+
standard query and not a Quick Find. Such queries are not subject to the 10,000 record
68+
limit. The reason being Quick Find queries with 1 or less conditions perform
69+
better as a standard query than a Quick Find.
70+
71+
## Avoiding the search limit exception
72+
73+
When writing and executing Quick Find queries in Dynamics 365 Customer ENgagement or Common Data Service, use the following tips to avoid the 10k search limit:
74+
75+
### Best practices when querying
76+
77+
The following best practices should be observed when querying data.
78+
79+
- Avoid adding unnecessary fields into the Quick Find query view
80+
- Keep queries as precise as possible avoiding generic queries and
81+
unnecessary wild cards
82+
83+
### Specific exception querying
84+
85+
If you have a specific need to have a query exceed this limit on a temporary basis, edit the FetchXML query to include setting the `overridequickfindrecordlimitenabled` attribute equal to 0 within the filter XML element. Use of this attribute will disable the 10k limit for the specific Quick Find query.
86+
87+
### Organizational override
88+
89+
In extreme cases where a business organization query regularly returns more than 10k search items, an administrator can contact Microsoft Support to request the 10k item limit be disabled. Disabling the limit is not recommended and can result in over consumption of resources and environment wide outages if misused.
90+
91+
### See Also
92+
93+
[Use FetchXML to construct a query](use-fetchxml-construct-query.md)

powerapps-docs/developer/common-data-service/webapi/query-data-web-api.md

+1
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ More information: [Use column comparison in queries](../column-comparison.md)
873873

874874
### See also
875875

876+
[Work with Quick Find’s search item limit](../quick-find-limit.md)
876877
[Web API Query Data Sample (C#)](samples/cdswebapiservice-query-data.md)<br />
877878
[Web API Query Data Sample (Client-side JavaScript)](samples/query-data-client-side-javascript.md)<br />
878879
[Perform operations using the Web API](perform-operations-web-api.md)<br />

0 commit comments

Comments
 (0)