Skip to main content
Dynamics 365 Community / Forums / Finance forum / The specified sequence...
Finance forum
Answered

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

editSubscribe (0) ShareShare
ReportReport
Posted on by 127
When I debugged code the error is due to AddGroupByField() on query build data-source: qbds.addGroupByField(FieldId)
Attachments
  • Hana Xue Profile Picture
    Hana Xue 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
    itlabnarmi_ivoruk 127 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
    Waed Ayyad 2,003 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
    MuthukumaranAX 2,893 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
    Layan Jwei 2,829 Super User 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
    itlabnarmi_ivoruk 127 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
    Hana Xue 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

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,130 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,689 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans