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

Notifications

Announcements

No record found.

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
    237,965 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
    237,965 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
    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
    237,965 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,032 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans