# duplicateFoundSet or copying a record and its related record

**URL:** <https://forum.servoy.com/t/duplicatefoundset-or-copying-a-record-and-its-related-record/1397>\
**Category:** Classic Servoy\
**Created:** [March 1, 2004, 11:38am UTC](https://forum.servoy.com/t/duplicatefoundset-or-copying-a-record-and-its-related-record/1397 "2004-03-01T11:38:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 1, 2004, 11:38am UTC](https://forum.servoy.com/t/duplicatefoundset-or-copying-a-record-and-its-related-record/1397/1 "2004-03-01T11:38:07Z")

</div>

What would be the best way to copy a record and all it’s related records into a new set. Something like copying a company including it’s addresses or whatever variant…

Can duplicateFoundSet() help me here? And if yes how?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [March 2, 2004, 9:59pm UTC](https://forum.servoy.com/t/duplicatefoundset-or-copying-a-record-and-its-related-record/1397/2 "2004-03-02T21:59:46Z")

</div>

what doe you mean into a new set?  
do you really want to duplicate everything in the database?

so a company “it2be” with a pk of 100 should be duplicated and given a pk of 200?  
and when you do that it should also duplicate all the related things??  
(that is a bit harder. your could go through through youre relations yourself and duplicate somehow every related record and set then the fk to the pk of the new parent record…

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 2, 2004, 10:21pm UTC](https://forum.servoy.com/t/duplicatefoundset-or-copying-a-record-and-its-related-record/1397/3 "2004-03-02T22:21:31Z")

</div>

Yes, that’s exactly what I was thinking of. I hoped it would be a little easier but ok…
