Views:

Overview

A regular requirement we come across is where a record needs to be cloned (copied) as well as its child and grandchild records. In this article we show how to add a button to the Account form that will: 

  • Clone the Account
  • Clone all Opportunities related to that Account
  • Clone all Product Line items related to any of those Opportunities

North52 Business Rules Engine for Dynamics 365 - Decision Table

North52 Decision Suite

The North52 Decision Suite solution works like this:

  • A Formula is set up on the Account which clones the Account, its Opportunities and their Product Line items
  • A Quick button is created that calls this Formula

Set up Formula and Quick Button

Formula

  • Create a new Formula, setting the following values in the Formula Guide:
    • Source Entity set to Account
    • Set Formula Type to Clientside - Calculation
    • Select the Classic editor
    • Select Create
  • Change the Name of the formula to Multi-Level Cloning
  • Click Create
  • Copy and paste the following Formula:
    Smartflow(
      
      SetVar('ClonedAccount',Clone('account',[account.accountid],'true') ),   
      
      ForEachRecord(   
        
        FindRecords('opportunity','parentaccountid',[account.accountid],SetFindSelect('opportunityid'),'50','true'),  
        
        SetVar('CurrentClonedOpp', Clone('opportunity',currentrecord('opportunityid'),'product_opportunities','true')),     
        
        UpdateRecord('opportunity',       
          GetVar('CurrentClonedOpp'),
          SetAttributelookup('parentaccountid','account', GetVar('ClonedAccount'))     
        )
        
      )
      
    )
  • Click Save

North52 Business Rules Engine for Dynamics 365 - Formula

Quick Button

Please see the article here for instructions on how to add a Quick Button to a form. 

Testing

To test this Formula, open an Account and click the button.

 

Did you know?

North52 Quick Tiles can be displayed on Dynamics Portals Entity Forms

That's right, you can display information via North52 Quick Tiles on an Entity Form. Display things like:

  • Number of cases remaining
  • Current support response time
  • Remaining credits
  • Outstanding balance
  • And much more...

Configure your rules/decision logic using North52 Decision Tables. You can have one, two, three…or ten tiles - you choose! 

Learn more about North52 Quick Tiles for Portals