Skip to content

Commit 2cafb0d

Browse files
committed
reverse order
1 parent 16af914 commit 2cafb0d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
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

0 commit comments

Comments
 (0)