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 :
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 166
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
    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
    166 on at
     
    this is not the same case with me, my issue is due to AddGroupByField() method on data-source. 
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi,
     
    Can you show us your full code? Where did you use orderBy?
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,903 on at
    is this called from a form datasource or are you constructing the query via code? 
  • Suggested answer
    Waed Ayyad Profile Picture
    9,073 Super User 2026 Season 1 on at
     
    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
    166 on at
    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
    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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans