You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/fetchxml/order-rows.md
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,9 @@ If you want to use *descending* order, set the `descending` attribute to `true`.
57
57
</fetch>
58
58
```
59
59
60
-
## Process `link-entity` orders last
60
+
## Process `link-entity` orders first
61
61
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.
63
63
64
64
The following example shows a conventional ordering pattern for both `link-entity` attributes and `entity` attributes.
65
65
@@ -76,20 +76,22 @@ The following example shows a conventional ordering pattern for both `link-entit
76
76
alias='parentaccount'>
77
77
<attributename='name'
78
78
alias='parentaccount' />
79
+
<!-- The link-entity parentaccount name -->
79
80
<orderattribute='name' />
80
81
</link-entity>
82
+
<!-- The entity account name -->
81
83
<orderattribute='name' />
82
84
</entity>
83
85
</fetch>
84
86
```
85
87
86
88
In this case, the results are ordered using following attributes:
87
89
88
-
- First => `parentaccountname.name`
89
-
- Last => `account.name`
90
+
- First => `account.name`
91
+
- Last => `parentaccountname.name`
90
92
91
93
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.
93
95
94
96
95
97
```xml
@@ -106,17 +108,19 @@ To ensure the `link-entity` order isn't applied first, move the `order` element
106
108
<attributename='name'
107
109
alias='parentaccount' />
108
110
</link-entity>
109
-
<orderattribute='name' />
111
+
<!-- The link-entity parentaccount name-->
110
112
<orderentityname='parentaccount'
111
113
attribute='name' />
114
+
<!-- The entity account name -->
115
+
<orderattribute='name' />
112
116
</entity>
113
117
</fetch>
114
118
```
115
119
116
120
Now, the results are ordered using the following attributes:
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/fetchxml/reference/order.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ This example return account records in ascending order by `createdon`, `name`, a
46
46
|`attribute`|Yes|The `name` of the [attribute element](attribute.md) to sort the data by.|
47
47
|`alias`|No|The `alias` of the [attribute element](attribute.md) to sort the data by|
48
48
|`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)|
0 commit comments