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 20

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?

  • HelioBuenos Profile Picture
    20 on at
    RE: calc (sum) line amount

    Hi Willy,

    Thank you!

  • WillWU Profile Picture
    22,352 on at
    RE: calc (sum) line amount

    Hi HelioBuenos,

    Please read this document:

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

  • HelioBuenos Profile Picture
    20 on at
    RE: calc (sum) line amount

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

  • HelioBuenos Profile Picture
    20 on at
    RE: calc (sum) line amount

    Hi Nikolaos,

    I forgot to mention that the NewField is on PurchReqTableListPage.

  • WillWU Profile Picture
    22,352 on at
    RE: calc (sum) line amount

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: calc (sum) line amount

    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.

  • HelioBuenos Profile Picture
    20 on at
    RE: calc (sum) line amount

    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.

  • Verified answer
    Martin Dráb Profile Picture
    231,856 Most Valuable Professional on at
    RE: calc (sum) line amount

    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"?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,041 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,856 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans