Hi,
I am trying to use a rollup field for the first time. I have a Case entity and it's child entity 'Expenses'. Each expense record has a currency field which in turn is a calculated field. This field calculates total amount of the expense record.
So, I need my rollup field to calculate the total of each expense record(Calculated field). I know that rollup fields can't reference a calculated field and So I've created a hidden currency field on expense record and added a script to copy the calculated value. And then, used that hidden field for calculating rollup value on Case form.
But nothing happens on the case form when I created a couple of expense records. The rollup field(on case Form) always remains blank, I did press refresh button. The calculation itself is fairly simple. Just the sum of all the expense amounts. What could be the reason.. please guide me through this.
Thanks for any help.
*This post is locked for comments
It's old but issue on existing source record is still present so updating the source record (anything, just temp modification of the name) and saving do the trick. After that the calculation button works
Hi meenoo,
I know this is an old thread, but I am experiencing the same problem with rollup fields that only work for newly created records. What do I have to do in order to get the rollup field working for the existing records?
Thanks,
Koen
I am not sure about the solution here, but would like to share my little RnD about Roll-up fields
https://vjcity.blogspot.com/2019/06/dissecting-rollup-fields-in-dynamic-365.html
I may be late to the party but can you share your script with me?
I am tryign to do somethign similar.
I created a calculated field to grab the parent account number.
then in turn i want to map the parent account number to the order entity.
I need a script to write the calculated parent account number 5 digits to the open field parent account so i can map that to order entity.
First time trying this so any help would be appreciated.
I figured the problem was with the transactioncurrencyid being 'null' for all the existing records that were created before rollup field. That's why all the new records with rollup field work properly.
I am not sure how to workaround through this issue. So opening new question about it.
As far as this thread, I was able to pass through this issue.
Thanks.
Yes, the unsaved changes error comes up for both business rule and script. I am trying to find a workaround for this.
One other strange issue I'm facing is, not sure if you have any answer for it.. but
The rollup field works only for new records and won't work for the existing records. I mean, for example, I have lots of cases already in the system where this rollup field was created on. It won't calculate for the existing cases and it's child records.
Works only if I create a new case and add child records with amount entered in them.
What do you think the reason could be? Please let me know your thoughts.. it will be big help for me to work through this.
Thanks.
Hmmmmm .... I guess the reason is the business rule is updating the actual field when you click save. Causing an unsaved change. (You may have had the same thing effectively happening with your script. Although as the browser refresh solved the problem you script could have always been working!)
I think I have seen something similar before but in my case I was updating the rolled up fields using a real time workflow. (You can get some workflow tools to do this on codeplex. https://msdyncrmworkflowtools.codeplex.com/)
I wonder if you could avoid this issue by setting the actual value using a workflow and also if needed force the roll up.
I think Melisa described rolled up fields as finicky. She is right as getting the timing bang on for the updates can be "finicky". (Especially as you have calculated fields involved.)
Ok, for some reason I thought of closing all the browsers and starting fresh did the trick!
The rollup field is now working.
Neil - I did build a business rule to set the hidden field which defaults to calculated amount on child entity instead of a script.
But, the only small issue is, whenever I save the child entity for the first time.. I am seeing 'Unsaved Changes' in the bottom. And until I hit 'save' again, the rollup value won't update even if I click 'refresh' button. Any workaround surrounding this small issue??
Thanks.
Thanks Melissa. I tried all your suggestions but still not working!
Thanks Neil. I did try creating a business rule to fill in the total in a hidden field. But it did not work as the 'Calculated total' field does not show up when I try to set it to the hidden field. I've tried to create business rule with scope as entity and the calculated field won't show up.
So I had to write a script to fill in the hidden field.
I've even tried setting up the rollup field to sum 'another' field(simple currency data type) of child entity and that won't work either. I am totally frustrated and not sure what else to try.
Thanks.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156