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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

how to do group by on an existing aot query by extension

(0) ShareShare
ReportReport
Posted on by 60

Hi,

I'm doing an extension on the TMSCommercialInvoice and it uses an AOT query object

I've extended the TMSCommercialInvoice query object with new datasources and I need to do a group by.

It doesn't allow it. So I'm wondering if there another way of doing group by on extended query?

Regards,

Brightlin

I have the same question (0)
  • Jeremy_Mounet Profile Picture
    170 on at
    RE: how to do group by on an existing aot query by extension

    Hi

    Maybe the easiest way to calculate this will be to implement a specific query in the processReport method of the Data Provider with the "group by" in the Data Provider class ?

    You could calculate this only when the shipmentId has changed by using  the method queryRun.changed(tablenum(WMSShipmentTable)) and avoid the calculation on every row (it depends to the excepted result).

    By this way, you don't change the standard design of the query.

    Jérémy.

  • Brightlin Profile Picture
    60 on at
    RE: how to do group by on an existing aot query by extension

    Yes, I know. It's because I need add the container table to sum up qty from the container  instead of using the qty of the loadline

  • Martin Dráb Profile Picture
    235,928 Most Valuable Professional on at
    RE: how to do group by on an existing aot query by extension

    If you added Group By to the query, it means the whole query would be grouped, not just the new data source. It sounds suspicious. Wouldn't it break the standard logic that uses the query?

    What exactly are you trying to achieve?

  • Suggested answer
    Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: how to do group by on an existing aot query by extension

    You have option of using query object in a code and then add datasource  to it and then do group by on it .

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 785 User Group Leader

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 621 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans