Skip to content

Commit 8da351b

Browse files
authored
Merge branch 'main' into marcel-YAML
2 parents 94054ac + 3a79248 commit 8da351b

File tree

57 files changed

+3273
-952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3273
-952
lines changed

.openpublishing.redirection.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "powerapps-docs/developer/data-platform/org-service/build-queries-with-queryexpression.md",
5+
"redirect_url": "queryexpression/overview",
6+
"redirect_document_id": "false"
7+
},
8+
{
9+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-queryexpression-class.md",
10+
"redirect_url": "queryexpression/overview",
11+
"redirect_document_id": "false"
12+
},
13+
{
14+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-conditionexpression-class.md",
15+
"redirect_url": "queryexpression/filter-rows",
16+
"redirect_document_id": "false"
17+
},
18+
{
19+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-filterexpression-class.md",
20+
"redirect_url": "queryexpression/filter-rows",
21+
"redirect_document_id": "false"
22+
},
23+
{
24+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-the-columnset-class.md",
25+
"redirect_url": "queryexpression/select-columns",
26+
"redirect_document_id": "false"
27+
},
28+
{
29+
"source_path": "powerapps-docs/developer/data-platform/org-service/page-large-result-sets-with-queryexpression.md",
30+
"redirect_url": "queryexpression/page-results",
31+
"redirect_document_id": "false"
32+
},
33+
{
34+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-left-outer-join-queryexpression-query-records-not-in.md",
35+
"redirect_url": "queryexpression/join-tables#find-records-not-in-a-set",
36+
"redirect_document_id": "false"
37+
},
38+
{
39+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-conditionexpression-class.md#column-comparison",
40+
"redirect_url": "queryexpression/filter-rows#filter-on-column-values-in-the-same-row",
41+
"redirect_document_id": "false"
42+
},
43+
{
44+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-conditionexpression-class.md#record-count",
45+
"redirect_url": "queryexpression/count-rows",
46+
"redirect_document_id": "false"
47+
},
48+
{
49+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-filterexpression-class.md#about-the-isquickfindfilter-property",
50+
"redirect_url": "quick-find",
51+
"redirect_document_id": "false"
52+
},
53+
{
54+
"source_path": "powerapps-docs/developer/data-platform/org-service/use-queryexpression-class.md#use-sql-hints-in-a-query",
55+
"redirect_url": "queryexpression/optimize-performance#query-hints",
56+
"redirect_document_id": "false"
57+
},
58+
{
59+
"source_path": "powerapps-docs/developer/data-platform/org-service/build-queries-with-queryexpression.md#configuration-for-quick-find",
60+
"redirect_url": "quick-find",
61+
"redirect_document_id": "false"
62+
},
363
{
464
"source_path": "powerapps-docs/developer/data-platform/tools/devtools-create-plugin.md",
565
"redirect_url": "/power-platform/developer/howto/vs-create-plugin",

powerapps-docs/developer/data-platform/attachment-annotation-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ More information:
10051005

10061006
- [Use the SDK for .NET](org-service/overview.md)
10071007
- [IOrganizationService.RetrieveMultiple Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple%2A)
1008-
- [Build queries with QueryExpression](org-service/build-queries-with-queryexpression.md)
1008+
- [Build queries with QueryExpression](org-service/queryexpression/overview.md)
10091009

10101010

10111011
# [Web API](#tab/webapi)
@@ -1081,7 +1081,7 @@ More information:
10811081

10821082
- [Use the SDK for .NET](org-service/overview.md)
10831083
- [IOrganizationService.RetrieveMultiple Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple%2A)
1084-
- [Build queries with QueryExpression](org-service/build-queries-with-queryexpression.md)
1084+
- [Build queries with QueryExpression](org-service/queryexpression/overview.md)
10851085
- [IOrganizationService.Update Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.Update%2A)
10861086

10871087
# [Web API](#tab/webapi)

powerapps-docs/developer/data-platform/auditing/retrieve-audit-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static void ShowNumberContactsDeletedByUserQE(
321321

322322
Learn more about:
323323

324-
- [Build queries with QueryExpression](../org-service/build-queries-with-queryexpression.md)
324+
- [Build queries with QueryExpression](../org-service/queryexpression/overview.md)
325325

326326

327327
`ShowNumberContactsDeletedByUserFetchXml` uses <xref:Microsoft.Xrm.Sdk.Query.FetchExpression> with a query composed using FetchXml.

powerapps-docs/developer/data-platform/best-practices/business-logic/implement-all-types-of-queries-when-filtering-preoperation-retrievemultiple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Unified Interface replaced the legacy web client for model-driven apps. Unified
7878
[Sample: Modify query in PreOperation stage](../../org-service/samples/modify-query-preoperation-stage.md)<br />
7979
[Query data using the SDK for .NET](../../org-service/entity-operations-query-data.md)<br />
8080
[Query data using FetchXml](../../fetchxml/overview.md)<br />
81-
[Build queries with QueryExpression](../../org-service/build-queries-with-queryexpression.md)<br />
81+
[Build queries with QueryExpression](../../org-service/queryexpression/overview.md)<br />
8282
[Limit the registration of plug-ins for Retrieve and RetrieveMultiple messages](limit-registration-plugins-retrieve-retrievemultiple.md)<br />
8383
[Unified Interface Community](https://community.dynamics.com/forums/thread/?discussionforumid=bc304ecc-c131-4b63-92dd-7464bba3ce3b)
8484

powerapps-docs/developer/data-platform/best-practices/work-with-data/retrieve-specific-columns-entity-via-query-apis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ Queries submitted to retrieve data from Dynamics 365 should not select all colum
144144
### See also
145145

146146
<xref href="Microsoft.Xrm.Sdk.Query.ColumnSet?text=ColumnSet Class" /><br />
147-
[Use of the ColumnSet Class](../../org-service/use-the-columnset-class.md)<br />
148-
[Build queries with QueryExpression](../../org-service/build-queries-with-queryexpression.md)<br />
147+
[Select columns using QueryExpression](../../org-service/queryexpression/select-columns.md)<br />
148+
[Query data using QueryExpression](../../org-service/queryexpression/overview.md)<br />
149149

150150

151151
[!INCLUDE[footer-include](../../../../includes/footer-banner.md)]

powerapps-docs/developer/data-platform/custom-api-tables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ GET [Organization URI]/api/data/v9.1/customapis?$select=
8181

8282
# [QueryExpression](#tab/queryexpression)
8383

84-
More information: [Build queries with QueryExpression](org-service/build-queries-with-queryexpression.md)
84+
More information: [Build queries with QueryExpression](org-service/queryexpression/overview.md)
8585

8686
```csharp
8787
string conn = $@"

powerapps-docs/developer/data-platform/fetchxml/aggregate-data.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,7 @@ The following example returns the number of related accounts in a column named `
231231
</fetch>
232232
```
233233

234-
## Limitations
235-
236-
Queries that return aggregate values are limited to 50,000 records. This limit helps maintain system performance and reliability. If the filter criteria in your query returns more than 50,000 records, you get the following error:
237-
238-
> Number: `-2147164125`
239-
> Code: `8004E023`
240-
> Message: `AggregateQueryRecordLimit exceeded. Cannot perform this operation.`
241-
> Client error message: The maximum record limit is exceeded. Reduce the number of records.
242-
243-
To avoid this error, add appropriate filters to your query to make sure it doesn't evaluate more than 50,000 records. Then run your query multiple times and combine the results. Appropriate filters depend on the nature of your data, but they could be a date range or a subset of values in a choice column.
234+
[!INCLUDE [cc-query-aggregation-limitations](../includes/cc-query-aggregation-limitations.md)]
244235

245236
### Per query limit
246237

powerapps-docs/developer/data-platform/fetchxml/filter-rows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ You can create filters that compare columns on values in the same row using the
162162
</fetch>
163163
```
164164

165-
### Cross table comparisons
165+
### Cross table column comparisons
166166

167167
With FetchXML only, you can compare field values in related tables. The following example returns rows where the contact `fullname` column matches the account `name` column.
168168

powerapps-docs/developer/data-platform/fetchxml/optimize-performance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you select many lookup and computed columns, and you're experiencing performa
2727
Using the `latematerialize` attribute might not always provide a performance benefit. It might make simple queries run more slowly. It's most beneficial when your query:
2828

2929
- Has many joins
30-
- Contains many columns lookup columns or computed columns
30+
- Contains many lookup or computed columns
3131

3232
## Query Hints
3333

@@ -37,7 +37,7 @@ Using the `latematerialize` attribute might not always provide a performance ben
3737
Microsoft SQL Server supports many query hints to optimize queries. FetchXML
3838
supports query hints and can pass these query options to SQL Server using the [fetch element](reference/fetch.md) [options](reference/fetch.md#options) attribute.
3939

40-
[!INCLUDE [fetch-options-table](reference/includes/fetch-options-table.md)]
40+
[!INCLUDE [cc-query-options](../includes/cc-query-options.md)]
4141

4242

4343
## No lock

powerapps-docs/developer/data-platform/fetchxml/order-rows.md

Lines changed: 4 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -130,110 +130,18 @@ The data contained by most column types is relatively simple and you can perform
130130

131131
When you order using lookup columns, the results are sorted using the primary name field for the related table. The database stores a GUID value. The [formatted value](select-columns.md#formatted-values) returned is the corresponding primary name field.
132132

133-
### Choice Columns
133+
### Choice columns
134134

135135
Choice column values are also sorted using the [formatted values](select-columns.md#formatted-values) rather than the values stored in the database. Data for these columns are stored as integers. The formatted value is a localized label based on the user's language.
136136

137-
This behavior can be overridden by setting the [fetch element](reference/fetch.md) `useraworderby` (*Use Raw Order By*) boolean attribute. When this attribute is set, all sorting of choice columns will use the integer values instead.
138-
139137
> [!NOTE]
140138
> Since choice sorting is based on the localized label of the users's language, expect different ordering for the results set if the user's language differs.
141139
142-
## Ordering and paging
143-
144-
How a page is ordered makes a big difference when paging data. If the information about how the results are ordered is ambiguous, Dataverse can't consistently or efficiently return paged data.
145-
146-
Add an order element to your query. If you don't add any order elements to your query, Dataverse adds an order based on the primary key of the table. However, when your query uses the `distinct` attribute, no primary key values are returned, so Dataverse can't add this default order. You must specify a paging order. Without any order specified, `distinct` query results might be returned in random order. [Learn more about returning distinct results](overview.md#return-distinct-results)
147-
148-
Paging is dynamic. Each request is evaluated independently as they're received. A paging cookie tells Dataverse the previous page. With this paging cookie data, Dataverse can start with the next record after the last one on the preceding page.
149-
150-
Paging works best going forward. If you go back and retrieve a page you previously retrieved, the results can be different because records could be added, deleted, or modified during since you last retrieved the page. In other words, if your page size is 50 and you go back, you get 50 records, but they might not be the same 50 records. If you keep progressing forward through the pages of a data set, you can expect all the records are returned in a consistent sequence.
151-
152-
### Deterministic ordering is important
153-
154-
*Deterministic ordering* means that there's a way to calculate an order consistently. With a given set of records, the records are always returned in the same order. If you need consistent orders and paging, you must include some unique or semi-unique column values and specify an order for them to be evaluated.
155-
156-
#### Nondeterministic example
157-
158-
Let's look at an example that is *nondeterministic*. This data set contains only **State** and **Status** information and is filtered to only return records in an open **State**. The results are ordered by **Status**. The first three pages are requested. The results look like this:
159-
160-
| State | Status | Page |
161-
|-----------|------------|---------------|
162-
| Open | Active | 1 Start |
163-
| Open | Active | 1 |
164-
| Open | Active | 1 End |
165-
| Open | Active | |
166-
| Open | Active | |
167-
| Open | Inactive | |
168-
| Open | Inactive | |
169-
170-
The paging cookie saves information about the last record on the page. When the next page is requested, the last record from the first page isn't included. However, given the nondeterministic data, there's no guarantee that the other two records on the first page aren't included in the second page.
171-
172-
To achieve deterministic ordering, add orders on columns that contain unique values, or values that are semi-unique.
173-
174-
#### Deterministic example
175-
176-
This query is like the [nondeterministic one](#nondeterministic-example), but it includes the **Case ID** column that includes unique values. It's also ordered by **Status**, but also ordered using **Case ID**. The results look like this:
177-
178-
| State | Status | Case ID | Page |
179-
|-----------|------------|-------------|---------------|
180-
| Open | Active | Case-0010 | 1 Start |
181-
| Open | Active | Case-0021 | 1 |
182-
| Open | Active | Case-0032 | 1 End |
183-
| Open | Active | Case-0034 | |
184-
| Open | Active | Case-0070 | |
185-
| Open | Inactive | Case-0015 | |
186-
| Open | Inactive | Case-0047 | |
187-
188-
In the next page, the cookie will have `Case-0032` stored as the last record in the first page, so page two will start with the next record after that record. The results look like this:
189-
190-
| State | Status | Case ID | Page |
191-
|-----------|------------|-------------|---------------|
192-
| Open | Active | Case-0010 | 1 Start |
193-
| Open | Active | Case-0021 | 1 |
194-
| Open | Active | Case-0032 | 1 End |
195-
| Open | Active | Case-0034 | 2 Start |
196-
| Open | Active | Case-0070 | 2 |
197-
| Open | Inactive | Case-0015 | 2 End |
198-
| Open | Inactive | Case-0047 | |
199-
200-
Because this query orders unique column values, the order is consistent.
201-
202-
### Best practices for orders when paging data
203-
204-
> [!NOTE]
205-
> When possible, queries should order on the primary key for the table because Dataverse is optimized for ordering on the primary key by default. Ordering by non-unique or complex fields cause excess overhead and slower queries.
206-
207-
When you retrieve a limited set of data to display in an application, or if you need to return more than 5,000 rows of data, you need to [page the results](page-results.md). The choices you make in determining the order of the results can determine whether the rows in each page of data you retrieve overlaps with other pages. Without proper ordering, the same record can appear in more than one page.
208-
209-
To prevent the same record from appearing in more than one page, apply the following best practices:
210-
211-
It's best to include a column that has a unique identifier. For example:
212-
213-
- Table primary key columns
214-
- Autonumber columns
215-
- User/contact IDs
216-
217-
If you can't include a column with a unique identifier, include multiple fields that will most likely result in unique combinations. For example:
218-
219-
- First name + last name + email address
220-
- Full name + email address
221-
- Email address + company name
222-
223-
224-
#### Anti-patterns for orders when paging data
225-
226-
The following are ordering choices to avoid:
140+
#### Override default choice columns sort order
227141

228-
- Orders that don't include unique identifiers
229-
- Orders on calculated fields
230-
- Orders that have single or multiple fields that aren't likely to provide uniqueness such as:
142+
You can override the default sort order for choice columns by setting the [fetch element](reference/fetch.md) `useraworderby` (*Use Raw Order By*) boolean attribute. When this attribute is set, all sorting of choice columns will use the integer values instead.
231143

232-
- Status and state
233-
- Choices or Yes/No
234-
- Name values by themselves. For example `name`, `firstname`, `lastname`
235-
- Text fields like titles, descriptions, and multi-line text
236-
- Non unique number fields
144+
[!INCLUDE [cc-ordering-paging](../includes/cc-ordering-paging.md)]
237145

238146

239147
## Next steps

0 commit comments

Comments
 (0)