Hi there,
I need to be able to apply an orderby clause to an annotated field (i.e. order on the "Case Created" string instead of the number 4 for the statuscode field on an incident entity).
Is this possible via the REST API?
When I attempt to use statuscode@OData.Community.Display.V1.FormattedValue in the orderby I get the following error:
{"error":{"code":"0x0","message":"Syntax error at position 54 in 'statuscode@OData.Community.Display.V1.FormattedValue asc'."}}
Please note the fields could be Option Sets or Lookup fields.
I might be able to use expand on a Lookup field but I don't believe this works on Option Sets?
Regards,
Andy
Andy,
I can just second what I said. You can't do it in a direct way.
But if you're ok with alternatives - you can store the label of the optionset in some text field and do the sorting by it.
Thanks for the quick response Andrew.
Is there no other way of doing this?
It would be very inefficient to download a large number (could be 100s or 1000s) of incidents to then perform client-side sorting on them and would ultimately lead to a poor end-user experience in our web application.
Regards,
Andy
Hello Andy,
I'm afraid that won't work this way. What you can do is to get the data and sort it afterward.
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102