Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Clone/copy Dynamics 365 record without saving it

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

    TOP CONTRIBUTOR
    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)?




    ------------------------------
    BR,
    Niels
    ------------------------------


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

    SILVER CONTRIBUTOR
    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.



    Clone

    Thanks

    Eric

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



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

    TOP CONTRIBUTOR
    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.

    ------------------------------
    BR,
    Niels
    ------------------------------



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

    GOLD CONTRIBUTOR
    Posted May 14, 2019 04:11 PM
    Niels,

    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

    TOP CONTRIBUTOR
    Posted May 15, 2019 12:58 AM
    @Andrew 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.


    ------------------------------
    BR,
    Niels
    ------------------------------



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

    SILVER CONTRIBUTOR
    Posted May 18, 2019 10:32 AM
    Edited by Abdul Majid May 18, 2019 10:35 AM
    HI @Niels 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

    TOP CONTRIBUTOR
    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).

    ------------------------------
    BR,
    Niels
    ------------------------------



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

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

    Hi @Niels Lønberg

    Sorry for the late reply.

    Let me know if the script comes through.

     Steps:

     

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

     Ribbon Editor

    Image 2 


    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
    ------------------------------

    Attachment(s)

    txt
    wwd_clonerecord.js.txt   3K 1 version


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