Tip #169: Update related records with a workflow

Ever wish you could use a workflow to update related/child records? For example, when I update the address on an account, update the address on all of the related contacts.

You can, with the help of the very helpful CRM 2011 Distribute Workflow Activity assembly written by Alberto Gemin on Codeplex.

While this says “CRM 2011” in the name, it works fine on CRM 2013 and CRM 2013 SP1.

  1. Import the solution from Codeplex
  2. Create your child entity workflow(s). In this example, create a workflow for the contact entity, check the box to run as a child workflow, uncheck the box to run on create of a record, and add your desired step.
  3. Create the master workflow that will trigger the child workflow. In this example it would be a workflow that runs on update of the address fields.
  4. Add a step. If you have successfully deployed the solution, you should see a new step called “DWF AG Utilities:Distribute One to Many.”
  5. In the step properties you need to specify two values: the database name of the 1:N relationship and the child workflow you created in step 2.
  6. Publish the workflow.

Now, every time the master workflow is executed, it will run the child workflow on each related record. This works with both background (asynchronous) and real-time (synchronous) workflow processes.

 

Tweet about this on TwitterShare on Facebook2Share on Google+0

5 thoughts on “Tip #169: Update related records with a workflow

  1. David says:

    I came across this post searching for this capability, but I also found another blog that actually gives the code for similar functionality:

    http://markuserlandsson.wordpress.com/2013/09/05/start-mulitple-workflows-on-related/

    I’d still recommend that people go to the above Codeplex site and download the step-by-step instructions, as it pertains to the use of this code as well.

  2. Tim Beljavskis says:

    Will this work with all 1:N relationships or only parental like Contact/Acct?

Leave a Reply

Your email address will not be published. Required fields are marked *