NickFaraday Posted April 28, 2008 Posted April 28, 2008 How do I copy an entire record (all fields) into the same table? There has got to be an easy way to do this? I want to copy every field from a table and make a new record with that data… an exact copy… Duplicate Record doesn’t work, because the resulting ‘records’ are the same exact instance of a record! I want an independent/standalone copy of the record, so if I delete one the other remains. I am trying to avoid creating a variable for every field in the table, so if later down the road, fields are added to the table, the script won’t have to be changed. Like I said there is probably an easy way to do this… I’m just missing it.
comment Posted April 28, 2008 Posted April 28, 2008 Duplicate Record doesn’t work, because the resulting ‘records’ are the same exact instance of a record! I don't think that is a correct statement. Duplicating a record creates a new, autonomous record. Deleting either one does not (necessarily*) delete the other. --- (*) However, if the record is deleted by deleting a related record with cascading delete turned on in the relationship's definition, the duplicate will be deleted too - because it too is related to the same parent record.
NickFaraday Posted April 28, 2008 Author Posted April 28, 2008 (edited) Thanks, It indeed seems like this is happening. I have a child table linked to the table I am duplicating, so when I delete the new 'duplicated' record it goes down the reference, deletes the related child, then back up the reference and deletes the original record. Edited April 28, 2008 by Guest
Recommended Posts
This topic is 6414 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now