In many cases you will want to make an exact copy of a record. In this article, we will be discussing about the options that you have, to exactly do that.
For simple entity records and when I say “simple” it means that you have an entity with some native fields as text, decimal, whole number, lookup and so on but we are not talking about many to many (N:N) relationships or many to one relationships (N:1), you could use native process workflows.
How you could do that?
These are the steps:
- Create an On-Demand workflow that should fire for the entity privileges that you are trying to copy
- In the first step, create a record of the same type of entity and map each field from source to target
For this example I will use a Quote entity:
Create a simple workflow:

And the mapping:

When you run an on-demand workflow under an existing record, the result will:

It was very simple, but what pass if you are trying to clone the quote and the quote details?
Remember that the quote details are a related entity. We can´t use a workflow to do that.
We are here to help you out with the Entity record clonation using Microsoft Dynamics. We try to solve the issues by creating necessary C# plugins to clone the records and details.
In this case, you will need to write a few lines of code to handle this situation.
I have designed a solution that involves a native process and a c# plugin to clone this kind of records and details.
Let me explain you:
-
1Create a flag field into the entity that you need to clone called “CloneRecord” of boolean type
-
Create an On-Demand workflow that should fire for the entity that you are trying to copy
-
This workflow set the “CloneRecord” field to “True”
-
-
Develop and register a CRM c# plugin on the Update of that field.
-
This workflow set the “CloneRecord” field to “True”
-
The plugin use the “EntityExtensions.Clone” method of the SDK to accelerate the copy of the entity
-
You will need to clone the “header” and “details” of the quote (for our example).
-
You should go and clone each detail records associated with header.
-
You need to know that when you clone a record with this method of the sdk, the "ID" ( guid ) is copied too. You need to remove this property of the attributes collection before create the record. If you forgot do this, the CRM Service Organization will return an error of duplicated key!
-
Example:
With this example you will be able to create the quote header. In order to clone details you should do this:

Thanks for reading this tutorial. The objective of writing this post is to discuss about different ways to clone entity records. The conclusion has been drawn after practical research and implementation by Microsoft Dynamics CRM Development team at Aegis Softtech.
For further information, mail us at [email protected]