Hi,
I have a scenario with Parent and child Accounts. Had to do multiple Roll up calculation on the Parent Account based on the fields in Child Accounts. Wrote a custom workflow to do all the calculations which works fine. But have a scenario below which fails.
Parent Account A has a Child Account C . Now On Child C I wanted to change the Parent Account From A to B.In this case the rollup calculations has to happen on the Parent Account B which works fine. I want to do the Calculations even on parent Account A also as the child C is no longer with parent A.
I tried calling 2 workflows on this. 1 is a asynchronous workflow which triggers after the parent account is changed and another workflow which is a real time workflow which triggers before the parent account is changed. But this is working when i tested with 1 field but when tried for multiple fields it is not working. Not sure before the real time workflow executes the asynchronous workflow starts executing and so the calculations are not happening correctly. My custom workflow only runs on child accounts. Can anyone help me with the ways that I can trigger the workflow on previous parent child account.
*This post is locked for comments
Thanks for the response David , I cannot use Rollup fields as we have more than 15 fields to calculate on an entity and we have limitation to not add more than 10 per entity. So had a custom workflow to do . Wrote 2 workflows to calculate all fields for Before and after changes. Was getting wrong results. However, we have modified the custom workflow to calculate the previous and current calculations. It works now after code change.
This should work in theory, and the synchronous before workflows should always run before the asynchronous ones.
Are you using one workflow to update multiple fields in each case, or one workflow per field ?
In what way is it not working ? Is the calculation not happening, or giving the wrong result ? If you enable auditing you can tell if the calculation is happening based on whether the field is updating
Alternatively, could you use rollup fields instead ?
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
52
Victor Onyebuchi
6