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, ...
Suggested Answer

Programmatically set "Group by" in new grid

(0) ShareShare
ReportReport
Posted on by 87

Hello,

I am trying to programmatically use the Grid Group by feature in Dynamics 365 F&O to initialize a grid grouped by a certain column instead of the user selecting it from the user interface. I tried using the Group By grid property but it has no effect. Is it possible to use the new grid group by feature from the code and if so can it be done on multiple levels (multiple columns) to initialize the grid. Kindly advise. Thank you.

Grid capabilities - Finance & Operations | Dynamics 365 | Microsoft Docs - for reference about the new Grid Group by feature.

pastedimage1655727150507v1.png

pastedimage1655726556779v3.png

I have the same question (0)
  • Suggested answer
    huijij Profile Picture
    19,813 on at

    Hi Anthony90288,

    The UI feature can also support to group by multiple columns.would you specify your business requirements?

  • Anthony90288 Profile Picture
    87 on at

    Hi Judy,

    I am aware that the UI feature allows grouping up to 5 columns. However, my requirement is to have my grid already be grouped by a certain column programmatically on the initialization of my grid so that the user doesn't have to do it from the UI. I tried the "group by" grid property but it has no effect.

  • Mariano Gracia Profile Picture
    on at

    Why don't you just save the view and mark it as the default view?, you will achieve your proposal without a single line of code

  • Anthony90288 Profile Picture
    87 on at

    Hi Mariano,

    Thanks for your suggestion. I am also aware of using saved views and setting it as default. However, I have logic where users can change a certain field value which triggers execution of a query which uses a table that is the root data source of the grid and thus grid contents will change so the grouping will be undone each time it is executed. Therefore that is why I want to do it through X++ if possible. I basically want to replicate the group by functionality on the grid UI inside my executequery method if possible

  • Sebastian Aurand Profile Picture
    1,650 on at

    Hey Anthony,

    did you find a solution for this in the meantime? I'm facing exactly the same requirenment.

    Thanks in advance.

    Sebastian

  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 621

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans