web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Roll up a Roll up Field!

(0) ShareShare
ReportReport
Posted on by 550

I have a rollup field that returns the total quantity of products listed in an invoice (sum of quantities in invoice product entity ) - I would call it "inv_total". In the order form , I need to rollup total quantity of related invoices. the problem is in creating rollup field , the  inv_total field is not there to aggregate sum .

Anyone had same need or problem ? Any idea?!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at
    RE: Roll up a Roll up Field!

    Hi Nima,

    I don't think you can rollup a rollup field, but there's a pretty easy workaround. Create a new Whole Number field on the invoice "inv_total_copy". Add a workflow to your invoice record that runs when the "inv_total" field is updated, and in the workflow you should set "inv_total_copy" to "inv_total". This will give you a non-calculated field with a calculated value, which you can reference in your next rollup.

    Hope this helps! If it does, I'd thank you if you would mark this as the verified answer.

    Thanks,

     Aiden

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: Roll up a Roll up Field!

    Nima,

    Short answer, you cannot rollup a rollup field.

    You need a plugin to calculate it.

    Thanks.

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: Roll up a Roll up Field!

    You do not need a plugin, you can do it OOB with the steps I described.

  • Verified answer
    Drew Poggemann Profile Picture
    4 on at
    RE: Roll up a Roll up Field!

    Hi Nima19864,

    I ran into this on my last project as well and found a way around it ;)  I created a direct relationship from the top level to the child's child.  Example, instead of having this:

    A --> B --> C 

    where A is the parent of B and B is the Parent of C I had to add this:

    A --> B - Parental relationship

    A --> C - I set this as a referential relationship only

    B --> C - Parental relationship

    When I added the C record I used the workflow to automatically set the A value on the record when created.

    This way I now had a way to total up using a rollup from A --> C.  

    I know this is kinda a work-around but it did the trick for me.  Hopefully this helps...

    Thanks,

  • Drew Poggemann Profile Picture
    4 on at
    RE: Roll up a Roll up Field!

    Hi Aiden, this is what I wanted to try as well but when I added a rollup field on the order (as an example) that totaled the lines of the order (just a test) and I created a second currency field that was a simple field that I was going to set in the workflow it did not give me any of the rollup fields to use in the "record fields change" so this did not work for me.  Maybe I missed something in my test if you got to work...

    Thanks,

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: Roll up a Roll up Field!

    Hi Drew,

    I hadn't tried it. You could try using the modified on field change as the trigger, but I'm not positive that the rollup field recalculation actually behaves like an update.

  • nima19864 Profile Picture
    550 on at
    RE: Roll up a Roll up Field!

    Hi Aiden

    I did try but as Drew has said the rollup field that sums up invoice product is not in the list of fields that a workflow can be triggered on change of it.

  • nima19864 Profile Picture
    550 on at
    RE: Roll up a Roll up Field!

    Hi Drew

    I had not tried it yet but I do fear making custom relationship between out of the box entities like invoice product and order. any how, thanks for the answer.  I might test it if people in the org will put me in pressure!

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: Roll up a Roll up Field!

    Hi nima,

    You could try using the modifiedon field as the trigger since that should be updated any time there's a field change, but I'm not 100% sure it changes when a rollup field changes.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Roll up a Roll up Field!

    Hi,

    I too had a requirement like this, unfortunately you cannot use a rollup field for rollup. Also, CRM doesn't provide the on change event of the rollup field. So you cannot write a workflow on change of the rollup field. What I did was, I created a direct relationship of the parent entity with the sub child entity so that I can have the rollup calculation directly from the sub child and not through the child. So, previously A was a parent to B and B was a parent to C. So I had to make A as a parent to C to achieve this.

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans