Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Query as FormDataSource, are aggregate fields not working properly?

(0) ShareShare
ReportReport
Posted on by 1,085

Hi,

i'm doing a simple form with a query as datasource.

The query joins SalesTable with CustInvoiceJour and CustInvoiceTrans. I'm trying to group by a custom field on custTable and then retrieve the sum of LineAmount of invoices trans.

This works like a charm when i use this query in a view. But when I put it as datasource on a form all the amounts are zero. Is there a specific method to calculate aggregate fields as Sums?

Thank you in advance

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    RE: Query as FormDataSource, are aggregate fields not working properly?

    Aha, OK.

  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    RE: Query as FormDataSource, are aggregate fields not working properly?

    I'm not aware of any such problem. Are you able to reproduce it in a minimized scenario (query with two fields, a form without anything else)? If so, can you share it?

  • Suggested answer
    vv1984 Profile Picture
    vv1984 1,085 on at
    RE: Query as FormDataSource, are aggregate fields not working properly?

    Sorry guys, found it.

    For your information:

    you have to set the Fields node's "Dynamic" property to "No"  and then add a new Sum field.

    Then you are able to add this Sum field in your Form's grid as if it was an actual field of your datasource.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans