Create Clone In MS CRM

clones

Very often we are troubled with writing huge codes and end up spending our valuable time for cloning an entity record. Just imagine the time needed if you are asked to create a cloned record with more than 100 attributes. Don’t you think it’s a time-consuming effort and how great would it be if all this could happen just with a couple of lines code?

The below sample code will guide you on how to create a clone

//remove original records guid
parentRecord.Id = Guid.Empty;
//remove parentRecord.LogicalName + “id”
parentRecord.Attributes.Remove(parentRecord.LogicalName + “id”);
//create Clone and get its guid
Guid childRecordId = service.Create(parentRecord);

explore more on same …

Cobalt 

Clone – Nishant Rana 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s