Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

calc (sum) line amount

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
    HelioBuenos 20 on at
    RE: calc (sum) line amount

    Hi Willy,

    Thank you!

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

    Hi HelioBuenos,

    Please read this document:

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

  • HelioBuenos Profile Picture
    HelioBuenos 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
    HelioBuenos 20 on at
    RE: calc (sum) line amount

    Hi Nikolaos,

    I forgot to mention that the NewField is on PurchReqTableListPage.

  • WillWU Profile Picture
    WillWU 22,350 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
    nmaenpaa 101,156 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
    HelioBuenos 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
    Martin Dráb 230,149 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans