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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

The specified sequence of Group By and Order By fields is not supported.

(0) ShareShare
ReportReport
Posted on by 135
When I debugged code the error is due to AddGroupByField() on query build data-source: qbds.addGroupByField(FieldId)
I have the same question (0)
  • Hana Xue Profile Picture
    Microsoft Employee on at
    The specified sequence of Group By and Order By fields is not supported.
    Hi,
    Before other development-savvy experts have any thoughts on this, based on the error message, you can check out this link:https://robscode.onl/d365-the-menu-item-with-name-could-not-be-opened/  And check if the fields support grouping and ordering, ensure that the field types used are compatible, and check if the order of grouping and ordering fields is correct.
    Best Regards,
    Hana
  • itlabnarmi_ivoruk Profile Picture
    135 on at
    The specified sequence of Group By and Order By fields is not supported.
     
    this is not the same case with me, my issue is due to AddGroupByField() method on data-source. 
  • Layan Jwei Profile Picture
    8,058 Super User 2025 Season 2 on at
    The specified sequence of Group By and Order By fields is not supported.
    Hi,
     
    Can you show us your full code? Where did you use orderBy?
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,903 on at
    The specified sequence of Group By and Order By fields is not supported.
    is this called from a form datasource or are you constructing the query via code? 
  • Suggested answer
    Waed Ayyad Profile Picture
    8,973 Super User 2025 Season 2 on at
    The specified sequence of Group By and Order By fields is not supported.
     
    It seems you're trying to do order by using group by field. You can't order by Aggregate group by, can you share your code in order to help you better?
     
    Thanks
    Waed Ayyad
     
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     
  • Verified answer
    itlabnarmi_ivoruk Profile Picture
    135 on at
    The specified sequence of Group By and Order By fields is not supported.
    Thank you guys for your valuable responses, In my case it was some data issue due to which it was throwing this error.
     
    Also I find this below line of code that it might be helpful if there is some sort of issue in group by on query through X++ code:
  • Hana Xue Profile Picture
    Microsoft Employee on at
    The specified sequence of Group By and Order By fields is not supported.
    Hi,
    Thanks for coming back and clarifying this issue, it will help others on the forum with the same problem.
    Best Regards,
    Hana

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 743

#3
Sumit Singh Profile Picture

Sumit Singh 551

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans