One of the common requirements I hear from customers is “can I clone a record in Dynamics CRM?” Usually the need for cloning arises to avoid duplicate data entries and to minimize errors in the process. Well, Dynamics CRM does not provide any out-of-the box feature to clone a record to create another. However, it does have the framework to get the work done.
The illustrated mechanism works if we just want to clone the direct data fields, but not any related records. For example, we want to clone a lead record to create another however, the connections of the lead record is not required to copy to the cloned record.
To implement such a cloning functionality, we need to create a self-reference for the entity. In our example, we will create a 1: N relationship between lead entity itself.
Step 1: Create a self-referential 1: N relationship
Step 2: Map the fields to be copied when the clone is created
Step 3 (optional but provides clean implementation): Use Ribbon Workbench* to Hide the “Add Existing Lead” button and rename the “Add New Lead” button to “Clone Lead” along with tool tip etc.. Changes accordingly.*RibbonWorkbench solution for Dynamics CRM 2013 can be downloaded for free from the following location: http://www.develop1.net/public/Download%20Ribbon%20Workbench%202013.aspx
Step 4: Publish all the customization.
To check the result, now navigate to the Sales | Lead section and pick up a lead record. Then navigate to the associated records section (as shown below). You can find Cloned Leads.
Click on Cloned Leads. You can see the “Clone Lead” button on the screen.
Click on the Clone Lead button. Bingo! A Quick Create Lead opens up copying the data from the existing record. Our clone functionality is working.