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

Notifications

Announcements

No record found.

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,811 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,827 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans