Customer Engagement & Dynamics CRM Forum

 View Only
Expand all | Collapse all

Clone/copy Dynamics 365 record without saving it

  • 1.  Clone/copy Dynamics 365 record without saving it

    Posted May 14, 2019 02:57 PM
    I'm looking for a way to easily clone/copy a current record in Dynamics 365.

    I have already tested some third-party solutions, like Dynamics Clone Pro and Click2Clone but they don't really work they I hoped the would as the save the record when it is cloned. 

    The functionality I'm looking for is like the one, that is available through @Natraj Yegnaraman's Chrome Extension, Level up for Dynamics CRM/365 'Clone Record'. However, I would like to make this functionality available for the users from within Dynamics 365 and not through a browser extension - as they can't install that. 

    The 'Clone Record' copies the fields of a current form to a new form, that opens in a new tab. The record isn't saved, so business rules are enforced which is important in my case. 

    Does anyone know of any tools that can do that, where it is also possible to define which attributes to clone/copy? Or if there are no such tools, would it be possible to create a custom button through @Scott Durow's Workbench Ribbon which runs a bookmarklet similar to the one that is used in the Level Up extension (or similar to these bookmarklets)? 


  • 2.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 14, 2019 03:08 PM
    Hi Niels,

    You could accomplish this with Flow.  We recently had a request to clone Opportunities and I built a quick Flow to test it and it worked pretty well.  The only thing that I'm not sure of would be opening the new record on creation but maybe someone else might have a suggestion on that.  If you have the Flow integration turned on you can run a Flow right from Dynamics.  

    My Flow was pretty simple - On Record Select - Get Opportunity - Create New Opportunity(populate fields from the Get Opportunity).  I also went a step further and got the Opp products and created those as well.




    Eric Veneziano
    Sales System Analyst
    Minitab, Inc.
    State College PA

  • 3.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 14, 2019 03:25 PM
    @Eric Veneziano,

    Thanks for your input.

    I thought about using either an on-demand workflow or a Flow as you suggested. However, that ​actually creates the record (which the Level Up functionality doesn't) and it doesn't take the user to the copied form. 

    What I do like about it, is that it doesn't require code - and we have built a no-code solution. But this particular part about copying records will be quite important for some of our users, so it must be as user-friendly as possible - which might require code or third-party tools.


  • 4.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 14, 2019 04:11 PM

    How flexible should it be? Do you want to define which fields are copied and what are not and what are requirements for your extension? As a developer I see many ways to implement your requirement but I'm curious how complex do you want it to be.

    Andrew Butenko

  • 5.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 15, 2019 12:58 AM
    @Andrii Butenko,

    ​I don't want it to be complex at all :)

    However, being able to define which fields are copied, as you can using third-party tools like Dynamics Clone Pro, would obviously be a nice feature. 

    If there are no such tools on the market, and if it is not something that can, relatively, easy be solved by using a bookmarklet or similar solution, I think we will either go for the workflow/Flow solution or using one of the third-party apps as they are. 


  • 6.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 18, 2019 10:32 AM
    Edited by Abdul Majid May 18, 2019 10:35 AM
    HI @Niels Søgaard Lønberg

    I may be able to help you here.

    I have a written a script to clone a record very similar to the one you describe using Level Up for Dynamics 365.

    I have placed a button on the ribbon and on click of the button it will open up a new form [contact in my case] with values copied from the main form.

    You can then amend the record before saving it for the first time. The record is not automatically created within the system.

    At the moment I have used it for contact but I guess it could be used for other entities too. Like the add-in you describe, it only copies the field values from the parent record you are cloning and not any related records.​

    Abdul Majid
    Westwood Software Limited

  • 7.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 20, 2019 01:02 AM
    @Abdul Majid,

    Is that something you would share with the community?

    Right now I'm looking into the Microsoft Flow solution suggested by @Eric Veneziano as this provides more flexibility​​​ in terms of maintainability compared to code - at least for me. I'm thinking of adding a view where the user can find the recently copied record(s).


  • 8.  RE: Clone/copy Dynamics 365 record without saving it

    Posted May 31, 2019 12:26 PM
      |   view attached

    Hi @Niels Søgaard Lønberg

    Sorry for the late reply.

    Let me know if the script comes through.



    1. Place the attached Web Resource in your solution
    2. Create a Button using Ribbon Editor and ensure you pass the execution context



    Pass in a CRM Parameter "PrimaryControl" this is how you can pass the execution context.


    1. Once you have added a button via Ribbon Editor on one of your records you can then similarly add the button to other forms too and execute the code in similar manner. The code does not need to be loaded by the form.


    There is limitation of 2000 characters in the URL, so hopefully you form is not very busy. This is version 1 of the script, in the next version I will setup a custom entity where you may set which attributes you would like to copy as part of the cloning.


    Please give it a go on your sandbox environment first and let me know how you get on if you or anyone else decides to use it.


    Abdul Majid
    Westwood Software Limited


    wwd_clonerecord.js.txt   3 KB 1 version

  • 9.  RE: Clone/copy Dynamics 365 record without saving it

    Posted Nov 17, 2020 07:45 AM
    Thank you Abdul Majid for your code, 

    It's very helpful.

    I tried to use your code using a demo environment which has unified interface wave 2 enabled, the code was not working, I did some changes to make it work.

    1- Primary Control which is passed from the button to the function call is an object of formContext directly not execution Context. 
    2- control.getKey() is not valid any more and its replaced by control.geName().
    3- If you want to clone the read-only field, it will fail since the status is not allowed to be initial status, I used the code to clone Opportunity record and update the status to their default statuses 
    4- I cleared the Opportunity ID (GUID ) 

    Attached the updated code Record_Clone.js

    Mohammad Khaleel 

    Mohammad Khaleel

  • 10.  RE: Clone/copy Dynamics 365 record without saving it

    Posted Nov 17, 2020 08:42 AM
    Hi Nils,

    our users also requested this function and I also didn't like the idea to code something.
    However it seems that it is not fully achievable. However here is what I did:
    1.) Create an old-school workflow, important part here is that I add the word COPY to a text-field that is also shown in subgrids etc., that way the users can easily identify the copied record (because: opening the copied record will not work without coding)
    2.) Install the 'SmartButton'-solution from Develop1
    3.) Open XRM Toolbox and then the RibbonWorkbench, create a new 'SmartButton' with one click and assigning the workflow
    4.) For added user acceptance you can place the button in multiple locations: on subgrids, in associated record views, directly in a record

    Our users can now mark an Opp in the subgrid of an account (they do not open it), click on Copy and will get a new Opp at the top of the subgrid with the added​ word COPY. They then change that Opp and of course also delete the word COPY from the text-field.
    Unfortunately it is not possible to copy any related records using workflows.


    Johannes Henkel

  • 11.  RE: Clone/copy Dynamics 365 record without saving it

    Posted Nov 17, 2020 08:47 AM
    This is quite an old thread 😊

    We went with the Power Automate solution as that gives us the most flexibility.

    Niels Lønberg
    Semco Maritime

If you've found this thread useful, dive deeper into User Group community content by role