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: docs/API/CollectionClass.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2230,7 +2230,7 @@ You can also pass a criteria parameter to define how the collection elements mus
2230
2230
|Constant| Type|Value|Comment|
2231
2231
|---|---|---|---|
2232
2232
|ck ascending|Integer|0|Elements are ordered in ascending order (default)|
2233
-
|ck descending|Integer|1|Elements are ordered in descending order
2233
+
|ck descending|Integer|1|Elements are ordered in descending order|
2234
2234
2235
2235
This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered).
2236
2236
@@ -3421,12 +3421,13 @@ You want to know if at least one collection value is >0.
3421
3421
3422
3422
</details>
3423
3423
3424
-
<!-- REF #collection.sort().Syntax -->**.sort**() : Collection<br/>**.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection<br/>**.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection<!-- END REF -->
3424
+
<!-- REF #collection.sort().Syntax -->**.sort**() : Collection<br/>**.sort**( *ascOrDesc* : Integer ) : Collection <br/>**.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection<br/>**.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection<!-- END REF -->
3425
3425
3426
3426
3427
3427
<!-- REF #collection.sort().Params -->
3428
3428
|Parameter|Type||Description|
3429
3429
|---------|--- |:---:|------|
3430
+
|ascOrDesc|Integer|->|`ck ascending` or `ck descending` (scalar values)|
3430
3431
|formula|4D.Function|->|Formula object|
3431
3432
|methodName|Text|->|Name of a method|
3432
3433
|extraParam |any |->|Parameter(s) for the method|
@@ -3440,7 +3441,17 @@ The `.sort()` function <!-- REF #collection.sort().Summary -->sorts the elements
3440
3441
3441
3442
>This function modifies the original collection.
3442
3443
3443
-
If `.sort()` is called with no parameters, only scalar values (number, text, date, booleans) are sorted. Elements are sorted by default in ascending order, according to their type. If the collection contains elements of different types, they are first grouped by type and sorted afterwards. Types are returned in the following order:
3444
+
If `.sort()` is called with no parameters, only scalar values (number, text, date, booleans) are sorted. Elements are sorted by default in ascending order, according to their type.
3445
+
You can also pass one of the following constants in the *ascOrDesc* parameter:
3446
+
3447
+
|Constant| Type|Value|Comment|
3448
+
|---|---|---|---|
3449
+
|ck ascending|Integer|0|Elements are ordered in ascending order (default)|
3450
+
|ck descending|Integer|1|Elements are ordered in descending order|
3451
+
3452
+
This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered).
3453
+
3454
+
If the collection contains elements of different types, they are first grouped by type and sorted afterwards. Types are returned in the following order:
Copy file name to clipboardExpand all lines: docs/API/EntityClass.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -334,6 +334,7 @@ vCompareResult3 (only differences on $e1 touched attributes are returned)
334
334
335
335
|Release|Changes|
336
336
|---|---|
337
+
|21|Added status 7 and 8|
337
338
|17|Added|
338
339
339
340
</details>
@@ -360,7 +361,7 @@ Otherwise, you can pass the `dk force drop if stamp changed` option in the *mode
360
361
361
362
**Result**
362
363
363
-
The object returned by `.drop()` contains the following properties:
364
+
The object returned by `.drop()` contains the following properties:
364
365
365
366
|Property|| Type |Description|
366
367
|---|---|--- |---|
@@ -387,10 +388,12 @@ The object returned by `.drop( )` contains the following properties:
387
388
388
389
|Constant| Value| Comment|
389
390
|---|---|---|
390
-
|`dk status entity does not exist anymore`|5|The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using entity.drop(), this error can be returned when dk force drop if stamp changed option is used. When using entity.lock(), this error can be returned when dk reload if stamp changed option is used</li> **Associated statusText**: "Entity does not exist anymore"|
391
+
|`dk status entity does not exist anymore`|5|The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using entity.drop(), this error can be returned when dk force drop if stamp changed option is used. When using entity.lock(), this error can be returned when dk reload if stamp changed option is used.</li> **Associated statusText**: "Entity does not exist anymore"|
391
392
|`dk status locked`|3|The entity is locked by a pessimistic lock.<br/> **Associated statusText**: "Already locked"|
393
+
|`dk status validation failed`| 7| Non fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Mild Validation Error"|
392
394
|`dk status serious error`| 4| A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.<br/>**Associated statusText**: "Other error"
393
-
|`dk status stamp has changed`| 2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<br/><li>with `.save( )`: error only if the `dk auto merge` option is not used</li><li>with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><li>**Associated statusText**: "Stamp has changed"</li>|
395
+
|`dk status serious validation error`| 8| Fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Serious Validation Error"|
396
+
|`dk status stamp has changed`| 2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<br/><li>with `.save()`: error only if the `dk auto merge` option is not used</li><li>with `.drop()`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><li>**Associated statusText**: "Stamp has changed"</li>|
394
397
|`dk status wrong permission`|1|The current privileges do not allow the drop of the entity. **Associated statusText**: "Permission Error"|
395
398
396
399
#### Example 1
@@ -987,10 +990,11 @@ The object returned by `.lock()` contains the following properties:
987
990
988
991
|Constant |Value| Comment|
989
992
|---|---|---|
990
-
|`dk status entity does not exist anymore`| 5 |The entity no longer exists in the data. This error can occur in the following cases:<li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop()`, this error can be returned when dk force drop if stamp changed option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>**Associated statusText**: "Entity does not exist anymore"|
993
+
|`dk status entity does not exist anymore`| 5 |The entity no longer exists in the data. This error can occur in the following cases:<li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop()`, this error can be returned when dk force drop if stamp changed option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>**Associated statusText**: "Entity does not exist anymore"|
991
994
|`dk status locked`| 3 |The entity is locked by a pessimistic lock.**Associated statusText**: "Already locked"
992
-
|`dk status serious error`| 4 |A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.**Associated statusText**: "Other error"|
993
-
|`dk status stamp has changed`|2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<li>with `.save( )`: error only if the `dk auto merge` option is not used</li><li>with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><br/>**Associated statusText**: "Stamp has changed"|
995
+
|`dk status mild validation error`|7|Can be returned by the developer only in validate events and do not require|
996
+
|`dk status serious error`| 4 |A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.<br/>**Associated statusText**: "Other error"|
997
+
|`dk status stamp has changed`|2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<li>with `.save()`: error only if the `dk auto merge` option is not used</li><li>with `.drop()`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><br/>**Associated statusText**: "Stamp has changed"|
994
998
995
999
#### Example 1
996
1000
@@ -1149,7 +1153,7 @@ The object returned by `.reload( )` contains the following properties:
1149
1153
1150
1154
|Constant| Value| Comment|
1151
1155
|---|---|---|
1152
-
|`dk status entity does not exist anymore`|5|The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop()`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>***Associated statusText***: "Entity does not exist anymore"|
1156
+
|`dk status entity does not exist anymore`|5|The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop()`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>***Associated statusText***: "Entity does not exist anymore"|
1153
1157
|`dk status serious error`|4| A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.<br/>***Associated statusText***: "Other error"|
1154
1158
1155
1159
#### Example
@@ -1180,6 +1184,7 @@ The object returned by `.reload( )` contains the following properties:
1180
1184
1181
1185
|Release|Changes|
1182
1186
|---|---|
1187
+
|21|Added status 7 and 8|
1183
1188
|17|Added|
1184
1189
1185
1190
</details>
@@ -1241,11 +1246,13 @@ The following values can be returned in the `status` and `statusText` properties
1241
1246
1242
1247
|Constant| Value |Comment|
1243
1248
|---|---|---|
1244
-
|`dk status automerge failed`| 6| (Only if the `dk auto merge` option is used) The automatic merge option failed when saving the entity.**Associated statusText**: "Auto merge failed"|
1245
-
|`dk status entity does not exist anymore`| 5| The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop( )`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>**Associated statusText**: "Entity does not exist anymore"|
1246
-
|`dk status locked`| 3| The entity is locked by a pessimistic lock.**Associated statusText**: "Already locked"
1247
-
|`dk status serious error`|4|A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.**Associated statusText**: "Other error"|
1248
-
|`dk status stamp has changed`|2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<br/><li>with `.save( )`: error only if the `dk auto merge` option is not used</li><li>with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><br/>**Associated statusText**: "Stamp has changed"|
1249
+
|`dk status automerge failed`| 6| (Only if the `dk auto merge` option is used) The automatic merge option failed when saving the entity. **Associated statusText**: "Auto merge failed"|
1250
+
|`dk status entity does not exist anymore`| 5| The entity no longer exists in the data. This error can occur in the following cases:<br/><li>the entity has been dropped (the stamp has changed and the memory space is now free)</li><li>the entity has been dropped and replaced by another one with another primary key (the stamp has changed and a new entity now uses the memory space). When using `.drop()`, this error can be returned when `dk force drop if stamp changed` option is used. When using `.lock()`, this error can be returned when `dk reload if stamp changed` option is used</li><br/>**Associated statusText**: "Entity does not exist anymore"|
1251
+
|`dk status locked`| 3| The entity is locked by a pessimistic lock. **Associated statusText**: "Already locked"|
1252
+
|`dk status validation failed`| 7| Non fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Mild Validation Error"|
1253
+
|`dk status serious error`|4|A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc. **Associated statusText**: "Other error"|
1254
+
|`dk status serious validation error`| 8| Fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Serious Validation Error"|
1255
+
|`dk status stamp has changed`|2|The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).<br/><li>with `.save()`: error only if the `dk auto merge` option is not used</li><li>with `.drop()`: error only if the `dk force drop if stamp changed` option is not used</li><li>with `.lock()`: error only if the `dk reload if stamp changed` option is not used</li><br/>**Associated statusText**: "Stamp has changed"|
1249
1256
|`dk status wrong permission`|1|The current privileges do not allow the save of the entity. **Associated statusText**: "Permission Error"|
0 commit comments