Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to display sum of multiple values for a form in AOT

Posted on by Microsoft Employee

Dear Experts,

Example: Behind the highlighted area (Remaining quantity) there's sum of various value quantities "On-order, Reserved physical and Picked". Currently out of 120, there's 80 Picked, 20 Reserved physical and 20 On-order. How do I tell the system in AOT to display sum only of 2 statuses "Reserved physical and On-order" so on my form it would show me remaining quantity 40 instead of 120?
TEST_5F00_1.png
Any suggestions are welcome.
Kind Regards,
V

*This post is locked for comments

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to display sum of multiple values for a form in AOT

    Please take your time to verify answers by ticking the checkbox next to each helpful answers in order to close the topic and assist other users with similar problems.

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to display sum of multiple values for a form in AOT

    That would be a calculation in a display method on the table. Then depending on what your source values are, you could do the summation in different ways. If it is data in one or more tables, you could join them together and do a sum() aggregate function for the values in a select statement, a query or a view.

    select sum(ValueA), sum(ValueB) from table where table.selectionField == 'selectioncriteria';

    return table.ValueA + table.ValueB;

    The same can be achieved by doing a View to retrieve the values. It could even be an SQL Computed Column on the View if needs to be. It really depends on how does your source information look like, and how much do you care about performance optimization for the function.

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans