Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Clone Parent and Child Records

Posted on by Microsoft Employee

I have an entity called Check List and another one called Check List Items. Each check list item is a record for a question and its respective answer.

I have found a way to clone the parent record and the relationship, but when I clone the record, I see the same check list items related to the cloned record as opposed to have the check list items also cloned and related to the new record that has been created when I cloned the parent. The actual scenario wouldn't work for me cause each check list will have different answers.

Is there anything that would help me clone the parent record, clone the child records and relate them to the new parent record?

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clone Parent and Child Records

    Hi,

    here is already a chunk of code: community.dynamics.com/.../246130

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clone Parent and Child Records

    Hi Lucas,

    we have a product Record Clone which allows 1-Click Cloning of any record

    in CRM.

    Below are some of the features :

    Ability to clone System entities as well as Custom and their related child entities

    Once cloned or copied, the newly created record pops up on the User Interface

    Ability to Clone multiple records too (making X Clones of a single record in a click)

    Can also Clone records from Workflows

    You can try our product by following the below link.

    www.work365apps.com/record-clone

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: Clone Parent and Child Records
    We have a product Click2Clone with below features.
    •  Offers the ability to clone system as well as custom entities.
    •  Easy to configure with the ability to select the fields to be carried over.
    •  Allowed to carry over related records from 1:N and N:N relationships.
    •  Quickly clone multiple records at a time.
    •  You can try our product by following the below link.
    Thanks!

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Clone Parent and Child Records

    Hi Lucas,

    A custom action appears to be the best solution here.

    However you need to create parent entity as well as all the associated child entity in a single call so that you dont end up having orphan record so do consider using ExecuteTransactionRequest whenever performing the cloning.

    The estimates depends on tasks. I can foresee 3 tasks here

    1) JavaScript button to call custom action (1hr)

    2) Plugin development (4hr)

    3) Unit test case (2hr)

    Thanks,

    PS

  • Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Clone Parent and Child Records

    1-2 hrs it will take to write code for cloning record.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clone Parent and Child Records

    Ok, thanks for the reply!

    I noticed on your profile that you are a developer. Would you consider creating a plugin that we could use to perform this process?

    If yes, how much time and effort do you think that this will require?

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Clone Parent and Child Records

    Basically you need to create new parent and new child records.

    TO do this, you can use dialog, workflow or ribbon button and need to add some code either in c#/VB.net or Javascript.

    If using dialog / workflow, you can create custom workflow activity which will get current record (which you want to clone), then in custom workflow activity code, you will create new parent record, and new child records from master record.

    you can create new child and parent relationship either when creating child record or need to create relationship after both parent and child records are created.

    If using ribbon button, then you need to do same way as explained in for dialog / workflow, only use need to use JavaScript code.

    hope this will give you some idea.

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

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans