apiodataacumatica

How to order the results by date?


I am using the Acumatica REST API. When retreiving results I can't seem to find a way to order the results by date (or any other field for that matter). I can $select and $filter but not $orderBy. Does anyone know how to do this in Acumatica? Thanks!

I tried to $orderBy with no success.


Solution

  • According to the Acumatica wiki...The result set returned by the data view is always sorted by the OrderBy clause specified in the type of the data view object. If you sort data records in a different way within the delegate, the result set will be reordered before it is returned by the data view.

    What you must do is create a simple generic inquiry with your data specified, along with a sort. Next add the GI as a sitemap item. Finally, add the GI results to your endpoint. Then you can call your custom endpoint entity with the sorting required.