Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Question on field calculation

Posted on by 255

Hi All ,

I have two entites.

1)A

2)B having 1:N relationship between them.

i have three currency fields on entity B.

i need to get  total of these three fields on entity "A" on field "Total".

how can i do this in dynamics crm.

  • erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: Question on field calculation

    Hi Mona,

    If my post answered your question, would you please verify my post?

    Thanks,

    Regards,

  • Verified answer
    Mona Chavan Profile Picture
    Mona Chavan 255 on at
    RE: Question on field calculation

    Thnaks

  • erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: Question on field calculation

    Hi,

    My understanding is that you want to sum all the Entity B records that is related to Entity A.

    For instance;

    • Record X in Entity A
      • Total Field = 28
    • Record Y1 in Entity B
      • Currency 1 = 1
      • Currency 2 = 5
      • Currency 3 = 10
    • Record Y2 in Entity B
      • Currency 1 = 2
      • Currency 2 = 4
      • Currency 3 = 6

    Is this right? If so, then here are the options;

    1. Option:
      1. Create a rollup field for Currency 1 on Entity A (Total of Currency 1)
      2. Create a rollup field for Currency 2 on Entity A (Total of Currency 2)
      3. Create a rollup field for Currency 3 on Entity A (Total of Currency 3)
      4. Create a calculated field on Entity A to sum Total of Currency 1, Total of Currency 2 and Total of Currency 3
    2. Option:
      1. Write a plugin to calculate the total
    3. Option:
      1. Write a WF and call a WF activity in it to retrieve and calculate the total

    Regards,

  • Suggested answer
    RE: Question on field calculation

    Hello Mona Chavan, how are you?

    Mona, regarding your scenario, I can recomend the use of calculated and rollups fields. 

    You can use a calculated field on entity B to sum those three currency fields and on entity A a calculated field that will do a sum on the calculated field.

    Please take a look on the article https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-calculated-fields on how to create a calculated field and https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-rollup-fields about rollup fields.

    There are also the limitations about each feature documented.

    Sample using contact and account entities.

    Contact A

    pastedimage1582550864585v1.png

    Contact B

    pastedimage1582550900875v2.png

    On Account (3 + 10) = 13

    pastedimage1582550957251v3.png

    Another product that could be used is Microsoft Power Automate, to create a flow that when a record is created or changed on entity B, sum all related records and update the entity A with the result of this sum. More details on https://flow.microsoft.com/ 

    I hope that this information could help on your scenario.

    Best regards.

    Rodrigo Hentz - Dynamics 365 Support Engineer

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans