Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to copy a calculated field and then use it to sum (using rollup field) in a different entity form?

(0) ShareShare
ReportReport
Posted on by 10

Hello!

I've created a calculated field in each of the lines Orders entity and then I need to use each one of these fields in the Invoice entity and add them using a rollup field.

Please your advice with this topic.

Regards,

Nicolas

  • Nhead Profile Picture
    Nhead 10 on at
    RE: How to copy a calculated field and then use it to sum (using rollup field) in a different entity form?

    Thanks for your answer Leah Ju.

    For the Orders entity I've created a rule to copy de calculated field in a new field (in the same form) and then use these results in the Invoice entity rollup field. But the problem is that the Orders entity has many lines (I upload the information using an Excel file) and I have to enter line by line to update the rule output field in order to be effective because the form doesn't refresh immediately.

    Do you know if there is a different and better solution?

    Kind Regards,

    Nicolas

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to copy a calculated field and then use it to sum (using rollup field) in a different entity form?

    Hi Nhead,

    Rollup fields are only supported over related entities with a one-to-many relationship.

    So you need create 1:N relationship between order line and Invoice entities, calculated fields in child records(order line) and rollup field in parent records (Invoice) in your scenario.

     pastedimage1610694115292v1.png

    And as IllerisJS mentioned, “A rollup can't reference a calculated field that uses another calculated field”, which does not mean that all calculated fields are not allowed to appear in the summary field configuration, just not for the secondary calculated fields.

    For example, calculate1 and calculate2 is a calculated filed from general fields, calculate3 is a calculated filed from another two calculated fields (1 and 2).

     pastedimage1610694740769v2.png   pastedimage1610694887017v3.png

    Now, go to rollup field configuration page, calculate1 and calculate2 fields can show in the list, but calculates3 field can't show.

    pastedimage1610696085838v4.png

    you can refer it to know how to set rollup field: https://www.encorebusiness.com/blog/rollup-fields-in-microsoft-dynamics-365-crm/ 

    If the calculated field you are using is the secondary calculated field, you can use js code to replace calculated field, which can use results in rollup field, you can refer my answer in the following thread:

    https://community.dynamics.com/365/f/dynamics-365-general-forum/412845/roll-up-field-for-sum-of-decimal-numbers 

    Or you can provide more detailed information about it, so that I can give you more detailed solutions.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • IllerisJS Profile Picture
    IllerisJS 40 on at
    RE: How to copy a calculated field and then use it to sum (using rollup field) in a different entity form?

    You do not. See community.dynamics.com/.../rollup-field-sum-calculated-field

    It is not possible to reference a calculated field from a rollup field.

    Alternative: use a PowerAutomate flow that triggers on order line and updates the above hierarchy ;-)

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

News and Announcements

Announcing Category Subscriptions!

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

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans