duplicateFoundSet or copying a record and its related record

Questions, tips and tricks and techniques for scripting in Servoy

duplicateFoundSet or copying a record and its related record

Postby IT2Be » Mon Mar 01, 2004 1:38 pm

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?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby jcompagner » Tue Mar 02, 2004 11:59 pm

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.....
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby IT2Be » Wed Mar 03, 2004 12:21 am

Yes, that's exactly what I was thinking of. I hoped it would be a little easier but ok...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Methods

Who is online

Users browsing this forum: No registered users and 36 guests