Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Cloning Records in Dynamics CRM

(1) ShareShare
ReportReport
Posted on by 790

 Hello,

What is the best approach to clone records in CRM (specifically quotes and orders and their respective line items)?

I know this can be done by using an ASP.NET page and many other ways.

I also want to open the cloned record to user when the cloning process finishes.

Thanks :)

*This post is locked for comments

  • Suggested answer
    MS CRM developer Profile Picture
    MS CRM developer 50 on at
    RE: Cloning Records in Dynamics CRM

    i came across the same scenario, but looking for Javascript command, Kindly suggest me.

  • Inogic Profile Picture
    Inogic 24,102 on at
    RE: Cloning Records in Dynamics CRM

    Hi Zmk,

    Kindly check the below tool which will satisfy your needs. Apart from copying data of quotes and orders and their respective line items, this tool also offers options to copy the data from one entity record to another entity along with the relationships. Using this tool you can open newly created record. You can also update the newly records while cloning the records.

     

    https://www.inogic.com/product/productivity-pack/click-2-clone-microsoft-dynamics-crm-records

     

    Thanks!

  • Zap Objects Profile Picture
    Zap Objects 913 on at
    RE: Cloning Records in Dynamics CRM

    You can take trial of ZapObjects Copy Record App too:
    https://zapobjects.com/apps/zap-copy-record/

    The app allows copying or cloning of record in single click. Once cloned, the newly created record is automatically opened up too!

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Cloning Records in Dynamics CRM

    Create a button called Clone (as suggested in previous comments), and call an Action from it.

    You can use process.js to call the Action:

    github.com/.../processjs

    You can use a workflow to set the values or use the following code using a plugin (sample is for Case Entity):

    The logic is pretty simple. You will need to retrieve your case entity record, and create a new case (which will return your new case id).

    Then you need to do a retrieve multiple on all child records, and do a create for each one. See sample below:

    Entity sourceCase = service.Retrieve("incident", caseId, new ColumnSet(true));

    Guid targetCaseId = CreateCase(sourceCase);

    // Retrieve All Child Records of Case

    // You will need to do this for each type of child record

    EntityCollection childRecords = service.RetrieveMultiple(query);

    if (childRecords.Entities.Count > 0)

    {

       foreach (Entity child in childRecords.Entities)

       {

          // Similar logic as the Create Case function

          CreateChildRecord(child);

       }

    }

        private Guid CreateCase(Entity sourceCase)

        {

            Entity targetCase = new Entity("incident");

            foreach (KeyValuePair<String, Object> attribute in sourceCase.Attributes)

            {

                string attributeName = attribute.Key;

                object attributeValue = attribute.Value;

                switch (attributeName.ToLower())

                {

                    case "scag_incidentid":

                        break;

                    default:

                        targetCase[attributeName] = attributeValue;

                        break;

                }

            }

            try

            {

                Guid targetCaseId = service.Create(targetCase);

                return targetCaseId;

            }

            catch (FaultException<OrganizationServiceFault> ex)

            {

                throw new InvalidPluginExecutionException("An error occurred in the Case function of the plug-in.", ex);

            }

        }

    Hope this helps.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cloning Records in Dynamics CRM

    Hi,

    Whether it is to clone- Quotes, Orders or any entity including their respective line items can be done with just 1 click using WORK 365 Record Clone App. You may check the free trial at https://www.work365apps.com/record-clone

    Yes, once you click on the clone button the new cloned record pops up and is ready to use/edit as per the need.

    Hope this helps, for any more details ping me at  ella@work365apps.com

  • Suggested answer
    VMarques Profile Picture
    VMarques 200 on at
    RE: Cloning Records in Dynamics CRM

    Try this free Solution by Cobalt. I've been using this for the last few months and its a great tool to duplicate any record... No need to write code. 

    http://www.cobalt.net/dynamics-crm-snapshot

    Here's a video that show how to clone invoices, but it can be done with any entity. 

    https://www.youtube.com/watch?v=Iti9nfgomDg

    Hope this helps.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cloning Records in Dynamics CRM

    Hello,

    You can add a custom button on the entity form. On the button click, you can add JavaScript code to launch a dialog. The dialog will create a new record of the same entity with the required details. Also, you can mention the link of the newly created record in the dialog (on a page).

  • zmk Profile Picture
    zmk 790 on at
    RE: Cloning Records in Dynamics CRM

    Thanks for the replies. However, Mansoor answer only copy direct data which is not my case. As for daehyun, using OOTB workflow  won't open the cloned record once created and also copy direct data.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cloning Records in Dynamics CRM

    How about to create on demand workflow in order to create clone records?

    And In the quotes  view, check the target record and run the workflow.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cloning Records in Dynamics CRM

    Hello,

    You can try below approach.

    dipankarbhattacharya.com/.../cloning-a-record-in-dynamics-crm-2013

    Mansoor

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans