Skip to content

Commit 323d93f

Browse files
authored
Merge pull request #9229 from MicrosoftDocs/jdaly-main-link-entity-orders
reverse order for process link-entity orders
2 parents 928e13f + 51e5896 commit 323d93f

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ If you want to use *descending* order, set the `descending` attribute to `true`.
5757
</fetch>
5858
```
5959

60-
## Process `link-entity` orders last
60+
## Process `link-entity` orders first
6161

62-
Dataverse always orders attributes specified by the `link-entity` before attributes for the `entity` element.
62+
Dataverse always orders attributes specified by the `link-entity` after attributes for the `entity` element.
6363

6464
The following example shows a conventional ordering pattern for both `link-entity` attributes and `entity` attributes.
6565

@@ -76,20 +76,22 @@ The following example shows a conventional ordering pattern for both `link-entit
7676
alias='parentaccount'>
7777
<attribute name='name'
7878
alias='parentaccount' />
79+
<!-- The link-entity parentaccount name -->
7980
<order attribute='name' />
8081
</link-entity>
82+
<!-- The entity account name -->
8183
<order attribute='name' />
8284
</entity>
8385
</fetch>
8486
```
8587

8688
In this case, the results are ordered using following attributes:
8789

88-
- First => `parentaccountname.name`
89-
- Last => `account.name`
90+
- First => `account.name`
91+
- Last => `parentaccountname.name`
9092

9193

92-
To ensure the `link-entity` order isn't applied first, move the `order` element from the `link-entity` element to the `entity` element and use the `entityname` attribute on the `order` element to refer to the `link-entity` `alias` value.
94+
To ensure the `link-entity` order is applied first, move the `order` element from the `link-entity` element to the `entity` element above the other `order` element, and use the `entityname` attribute on the `order` element to refer to the `link-entity` `alias` value.
9395

9496

9597
```xml
@@ -106,17 +108,19 @@ To ensure the `link-entity` order isn't applied first, move the `order` element
106108
<attribute name='name'
107109
alias='parentaccount' />
108110
</link-entity>
109-
<order attribute='name' />
111+
<!-- The link-entity parentaccount name -->
110112
<order entityname='parentaccount'
111113
attribute='name' />
114+
<!-- The entity account name -->
115+
<order attribute='name' />
112116
</entity>
113117
</fetch>
114118
```
115119

116120
Now, the results are ordered using the following attributes:
117121

118-
- First => `account.name`
119-
- Last => `parentaccount.name`
122+
- First => `parentaccount.name`
123+
- Last => `account.name`
120124

121125
## Ordering lookup and choice columns
122126

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This example return account records in ascending order by `createdon`, `name`, a
4646
|`attribute`|Yes|The `name` of the [attribute element](attribute.md) to sort the data by.|
4747
|`alias`|No|The `alias` of the [attribute element](attribute.md) to sort the data by|
4848
|`descending`|No|Whether to sort the data in descending order.|
49-
|`entityname`|No|Use this to specify sort order for `link-entity` elements so that they are not applied first. In an `order` within an `entity` element, set `entityname` to the `alias` value of a `link-entity`. [Learn how to apply `link-entity` orders last](../order-rows.md#process-link-entity-orders-last)|
49+
|`entityname`|No|Use this attribute to specify sort order for `link-entity` elements so that they aren't applied last. In an `order` within an `entity` element, set `entityname` to the `alias` value of a `link-entity`. [Learn how to apply `link-entity` orders first](../order-rows.md#process-link-entity-orders-first)|
5050

5151
## Parent elements
5252

0 commit comments

Comments
 (0)