Hi,
We're looking for the best approach to updating values throughout the hierarchy of Accounts for our CRM 2013 solution.
The Account entity form has two custom numerical fields: 'Number of employees' and 'Group number of employees'.
Also, an Account entity record can have 'Parent' Account as well as a 'Grand Parent' Account.
'Group number of employees' is a sum of all 'Number of employees' values across all Accounts. We need to make sure that whenever the value of 'Number of employees' changes on any of the Accounts the 'Group number of employees' will be updated and the value redistributed across the hierarchy.
- If 'Number of employees' is updated on AC 1 from 0 to 50, the 'Group number of employees' number should be updated to 550 on all accounts - AC1, AC2, AC3, AC4, and AC5.
- If 'Number of employees' is updated on AC 2 from 250 to 350, the 'Group number of employees' number should be updated to 600 on all accounts - AC1, AC2, AC3, AC4, and AC5.
- If 'Number of employees' is updated on AC 4 from 100 to 500, the 'Group number of employees' number should be updated to 900 on all accounts - AC1, AC2, AC3, AC4, and AC5.
We've been trying to use the Generic Rollup solution (https://crmgenericrollup.codeplex.com/) however, this will work only when updating Parent records but not Child.
Any help and suggestions are appreciated.
Many thanks.
*This post is locked for comments
Hi,
Since you're working in 2013, your options are more limited than in 2015 (which has an Under condition). I think you'll need to handle this recursively in a plugin. Register a plugin on the account that fires when No. of Employee changes. Here's the plugin logic:
That should do it. If you had 2015, you could simplify steps 3, 4, and 5 by querying for accounts UNDER the root, but the rest of it would be the same. If you don't have any development resources, I could build this out for you pretty quickly.
Hope this helps! I'd appreciate if you'd mark this as Answering your question.
Thanks,
Aiden
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156