Tools, Ultimate Workflow Toolkit

UWT: Copying of N-N related records with no code

In this post I will provide instructions how you can copy N-N related records using latest release of Ultimate Workflow Toolkit without any code.

Let’s consider typical scenario – qualification of Lead. Both Lead and Account have N-N relationship with entity Industry. When user wants to qualify Lead – Industries that are related to it have to be copied into Account that is created during qualification. Here is how it can be done:

Create “Industry” related action:

Add “Entity Reference” input with “Account” as a target entity:

After that add “UWT: N-N Operations: Associate Entities” step from Ultimate Workflow Toolkit:

and configure it:

set “Record 1 Reference” to “Url” for Industry, “Record 2 Reference” to “Url” for Account and “Relationship Name” to name of relationship between “Account” and “Industry” (uwt_industry_account) in my case.

Activate Action and close it.

Create “Account” workflow that should be executed on its “Create” event:

As a first step add a check that Account was created from Lead – “Originating Lead” has to contain value and if it does not – just stop the workflow execution:

With the next step start the preparation of special “Request” object that will be used in further steps – add a “UWT: Request Builder: Set Lookup Field” step to workflow:

and then configure it:

where “Field Value” is a reference to your account, “Field Name” – name you give to “Account” Input from Action you created on step 1. Leave “Request” field blank – it is used when you have multi-step population of fields of “Request” object.

The next step is to add “UWT: Bulk Operations: Distribute Action” step to workflow:

Here is how you need to configure it:

Set “Request” to “Modified Request” output of “Set Lookup field” step, populate “Action Name” with “Unique Name” of Action you created in a first part, pass “Url” of “Originating Lead” field of current account and set “Relationship Name” to uwt_industry_lead (this is the name between Industry and Lead in my case). Save and Activate your workflow.

So that’s it – let’s check it in action:

4 Comments on “UWT: Copying of N-N related records with no code

  1. Hi Andrew, would I be able to copy the Opportunity Products from one Opportunity to a new opportunity using this process as part of a workflow?

    The scenario I am struggling with is that we create a new opportunity from an existing opportunity on close of the first opportunity for the subsequent years renewal and I want this new opportunity to contain the same opportunity products as the original oppportunity that I am copying?

    1. Hello Simon,
      Approach will be similar to one that is provided in this post with the exception that you will have to use Opportunity -> Add Detail instead of Associate N-N records.
      Feel free to get in touch if you have any issues.
      Andrew

      1. Thanks Andrew. I’ve had a go at setting this up but the opportunity products are not being copied across. I think it’s to do with the Action not firing as the workflow shows the usual green ticks against each line item, but the Action does not have any process Sessions logged.

        Can I message you the screenshot of my action setup please? Not sure how to post it here…

        1. Simon,
          You can save screenshots somewhere online and leave references here.
          Andrew

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.