Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Summarizing data from child entity on parent entity

(0) ShareShare
ReportReport
Posted on by 12

I need to display a summation of the amount field on the invoice record from any invoice detail where the invoice detail was taxed.  

Example:

Invoice Detail 1:  Amount $10.00 - Tax $1.00 - Extended Amount - $11.00

Invoice Detail 2:  Amount $100.00 - Tax $12.00 - Extended Amount - $112.00

Invoice Detail 3:  Amount $50.00 - Tax $0 - Extended Amount - $50.00

On the invoice level, I would want to show a taxable sales amount of $110.00 as those are the only taxable invoice details.  I am not sure how best to achieve this, Workflow, roll-up, or calculated field.   My first thought was workflow where it would run on each invoice detail line and if it meets the criteria, add it to a field on the invoice.  I can populate the first invoice detail of $10.00 but unable to keep the $10.00 and then add the $100.00 for the next line.   I am new to this and any ideas would be welcome. 

Thanks,

Jason

*This post is locked for comments

  • Jason Yusko Profile Picture
    Jason Yusko 12 on at
    RE: Summarizing data from child entity on parent entity

    Thank you all.  I was able to roll out the rolll-up field this weekend and it works great! 

    Best,

    Jason

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Summarizing data from child entity on parent entity

    In general I'd suggest the rollup field. This is easily and likely to be more robust than other approaches - the problem with recalculating through plugins or workflows is that you should cover all scenarios (create, update and delete of the child records

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,052 on at
    RE: Summarizing data from child entity on parent entity

    Hi

    You won't be able to use calculated for this as it will only work with fields from Current Record or parent record.

    Like Charles suggested roll-up Field would be the best option for you although it could also be done using a plugin or a Custom Workflow Activity used in a Workflow.

    When you can create the roll-up field, you can set it to do the sum based on the conditions you mentioned above

    [View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/define-rollup-fields:750:50]

    Since roll-up fields calculate from child records,  it will only update every 12 hours( you can set it to do every hour). 12 hour limit is the set as default for performance reasons.

    Please see the link below to read more about these settings

    https://community.dynamics.com/365/b/sachinbansalmicrosoft/archive/2018/05/07/dynamics-365-rollup-fields-important-points

    But if you have to update the total instantly or as soon as the Invoice Detail values change, you can force the roll-up calculation on demand and it will update instantly.

    To force the roll-up, you can use free workflow tools available or you could create a CWA as shown below

    ScreenClip-_5B00_48_5D00_.png

    This link has the full detail: https://dynamicscrmpros.com/changing-rollup-calculation-frequency-microsoft-dynamics-crm-2015/

    If you dont want create your own and okay with importing community workflow tools, you could use Force Roll-up calculate from the following tool

    ScreenClip-_5B00_48_5D00_.png

    https://archive.codeplex.com/?p=msdyncrmworkflowtools

    If you do not like any of the above approaches,  and if you are familiar with creating plugins, you could have a plugin to trigger on update/create on invoice detail and update the total on the invoice. 

    Hope this helps

  • Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: Summarizing data from child entity on parent entity

    Hi Jason,

    You can create a rollup field on the invoice entity.

    When creating a rollup field, you have the ability to add conditions on the children "Invoice Details" records where the calculation will be done. In your case, you have to select all the taxable invoice details.

    Charles Abi Khirs.

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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans