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, ...
Answered

calc (sum) line amount

(0) ShareShare
ReportReport
Posted on by 62

Hi,

I have a question. How can I sum LineAmount of PurchRequisition based on PurchReqId? I need to show sum of LineAmount based on the PurchReqId into new field (NewField).
Should I add method in table or form?

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

    I guess you're going to write a display method. You should put it to the table, because then you can cache it. It's extremely important from performance perspective.

    By the way, why did you attach tags "Connector for CRM" and "Administration and Setup"?

  • HelioBuenos Profile Picture
    62 on at

    Hi Martin,

    [quote]

    I guess you're going to write a display method. You should put it to the table, because then you can cache it. It's extremely important from performance perspective.

    By the way, why did you attach tags "Connector for CRM" and "Administration and Setup"?

    [/quote]

    Is there any other alternative way instead of write a display method?

    I have edited the tags you mention.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Yes, you can also maintain the sum in some physical field. But that's a lot of effort since you need to capture every possible process that can impact the sum, and trigger recalculation of that field.

    So, if you just want to show the sum of lineAmount, a display method is most likely the best approach.

  • WillWU Profile Picture
    22,361 on at

    Hi HelioBuenos,

    You could also extend the PurchReqTable table and add your new field. Then extend the PurchReqLine table, and write your code of the calculation logic to its INSERT \ Update \ DELETE method.

    Here is a same thread:

    community.dynamics.com/.../in-x-calculate

    Hope this helps.

  • HelioBuenos Profile Picture
    62 on at

    Hi Nikolaos,

    I forgot to mention that the NewField is on PurchReqTableListPage.

  • HelioBuenos Profile Picture
    62 on at

    I am still new in AX, can you please help me with display method?

  • WillWU Profile Picture
    22,361 on at

    Hi HelioBuenos,

    Please read this document:

    docs.microsoft.com/.../using-the-display-method-modifier

  • HelioBuenos Profile Picture
    62 on at

    Hi Willy,

    Thank you!

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 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans