2021 Jul 15 9:25 AM
I want to find the earliest start of a task entity at a certain location with an odata v2 read operation.
This is the code
oModel.read("/Tasks", {
filters: [new Filter("location_ID", FilterOperator.EQ, sLocationID)],
sorter: [new Sorter("actualStart", false)],
urlParameters: {
$top: 100 // revisit
},
success: function (oData) {...
I usually only have to use "$top: 1" as this first entity contains the earliest task.
But I realised that the data is not sorted.
When I look at the HTTP request then the payload doesn't contain any "orderBy" statement.
SAP support told me to ask a question here as it is custom code.
Can anyone see an error in my code? I used such read operations with a sorter many times and can't see a mistake.
2021 Jul 15 4:43 PM
Subhajit provided the corect answer in his comment. Thanks very much!
Not sure how many times I checked the code but couldn't see it...
2021 Jul 15 4:27 PM
2021 Jul 15 4:43 PM
Subhajit provided the corect answer in his comment. Thanks very much!
Not sure how many times I checked the code but couldn't see it...