Skip to main content

Notifications

Announcements

No record found.

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)
  • 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
  • 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:
  • Suggested answer
    Waed Ayyad Profile Picture
    7,941 Super User 2025 Season 1 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
     
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,901 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? 
  • Layan Jwei Profile Picture
    7,727 Super User 2025 Season 1 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?
  • 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. 
  • 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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,011 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans