Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Problem with orderby in Odata query

(1) ShareShare
ReportReport
Posted on by 737

Hello,

I am trying, using orderby, to sort the received data from OData.
However, it is not working for me - doesn't sort..

I using:

[*d365URL*]/data/[*data entity collection name*]?&orderby=[*field*]

Is this no longer supported?

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/793b1e83-95ee-4446-8434-f5b634f20d1e

Thanks.

  • CS-15051251-0 Profile Picture
    CS-15051251-0 4 on at
    Problem with orderby in Odata query
    Hey All,
     
    I came across this issue with a client using the "General Ledger Entries" Page 20 as an OData data source. After some testing, I have learned that $orderby will not work when the data source is a page that has default sorting defined by the SourceTableView property.
     
    Thanks
  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: Problem with orderby in Odata query

    Hi Shooowtek,

    The orderby query is supported, I noticed that you have used the wrong symbols. Please try with the symbols ‘$’ again.

    [*d365URL*]/data/[*data entity collection name*]?$orderby=[*field*]

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with orderby in Odata query

    How is the data sorted by default in the data entity?

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with orderby in Odata query

    Unfortunately it doesn't work on my custom data entity.

    Does anyone have any suggestions?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Problem with orderby in Odata query

    I have tried with my custom Data entity and sorted on Qty field and it worked perfectly fine. I don't think there is any extra setting or property required.

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with orderby in Odata query

    Hello,

    I can see that sorting does not work on custom data entities..

    I tried comparing my entity to standardoywch, but found nothing. Is some settings responsible for OData sorting? Or maybe the custom tables I created don't have the right settings?

    Thanks.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Problem with orderby in Odata query

    Hi, I have tried below query, Orderby is working as expected

    xxxxxx.sandbox.operations.dynamics.com/.../CustomerGroups

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans