Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Trigger workflow on previous child account when parent Account is changed

Posted on by 140

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

  • GPrasanna Profile Picture
    GPrasanna 140 on at
    RE: Trigger workflow on previous child account when parent Account is changed

    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.

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Trigger workflow on previous child account when parent Account is changed

    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 ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans