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 :
Microsoft Dynamics AX (Archived)

AX 4 group by?

(0) ShareShare
ReportReport
Posted on by 931

Hi all,

I have three tables.

when i make a entry in table A(10 fields), it will insert into table B(5 fields) and table C (5 fields).

Now, i have form A with the data source table B which has 5 fields. eg.(Customer Account, Name, Division, Date).

When i open the form A, the records should be grouped. if i have 3 records customer account as 1000 , i want to display only one record with range of Customer Account,Division,Date.

In AX4 there is no querybuilddatasource.addgroupbyfield().

Is there any other option where i can achieve this.

Thanks,

Rusty.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Use addSortField() together with orderMode(OrderMode::GroupBy).

  • ThivaKar Profile Picture
    931 on at

    Yes, i tried that.

    in my init() method

    qbds = query.addDataSource(tableNum(MyTable));

       qbds.addRange(fieldNum(MyTable,CustAccount));

       qbds.addSortField(fieldNum(MyTable,CustAccount));

       qbds.orderMode(orderMode::GroupBy);

    But nothing happens.

    if i remove the range. then my form is empty.

    i also tried in executequery() method.

    but only customer account values are showing. all the values are same and should be displayed.

  • ThivaKar Profile Picture
    931 on at

    Please ignore.

    Executequery() method works just as fine.

    Thanks.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans