web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

How to sort data on Odata

(0) ShareShare
ReportReport
Posted on by

Hi

I am working on Odata. I have created data entity to show sales order line item.

I am trying to sort Odata details based on  datasource "InventTrans", "Qty" field.

It would be a great help if you provide me solution (how to sort data   based on  datasource "InventTrans", "Qty" field -->  Odata sort the deatils based on InventTrans "Qty." field )

OData datasource structure:

pastedimage1595594397860v1.png

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    What you're looking at is a data entity definition, not OData services.

    If you want to use OData to sort by InventTrans.Qty, expose this data source field as an entity field. Let's say it'll be called InventTransQty. Then you can use an OData query like this:

    https://myAx.cloudax.dynamics.com/data/MyLines?$orderby=InventTransQty

  • Community Member Profile Picture
    on at

    Thanks Martin.

    I am looking to sort data at data entity level. Below example, I wants to show on Odata

    Example: 1 line with 10 qty. breaks into three line and we have displayed these breaks qtys. using "InventTrans" table

    on the inventTrans datasource levels we want to sort "inventTrans" details.

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    I don't think what you ask for is possible. Ordering is what you do by a query and when you want to do it via OData, you have the solution in my previous reply.

  • Yoko Isono Profile Picture
    Microsoft Employee on at

    Unfortunately the sort feature of entity data is not provided for now, because it requires a lot of resources and can impact system performance.
    We are recommended to export entity data to SQL database by BYOD etc. once and execute sorting if needed.

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    What is the source of this information? I can't confirm it - sorting does work for me.

  • Suggested answer
    Rahul Mohta Profile Picture
    21,042 on at

    while calling , could use the option to retrieve sorted data using $orderby

    see if this helps

    docs.microsoft.com/.../odata

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 254

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 188 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 131 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans