I have to copy the contents of a record (Let’s say item card) to a new record in the same table. There is around 70 fields on this record, and I need to copy all but two of them. In these two new fields, I will be creating a new code and description. I have tried using a temporary table to TRANSFERFIELDS and then MODIFY the two records that I need. Then transfer this to the table as a new record. Unfortunately, this does not allow me to do this, and I do not want to have to map every field individually. Can anyone help ??
Using transferfields should work ! Do you get any erros or what ? Also no need for temporary tables, just do like this: NewRec := Rec; NewRec.PrimaryField := NewPrimary; NewRec.OtherField := NewValue; NewRec.INSERT; This creates a new record as a copy of the original. Remember to give new values to the primary fields ! and change the fields you want to have a nes value. BTW: If this is “just” to copy the record you could do it by Cut&Paste and just manually change the primary field and other values…
Once you have used TRANSFERFIELDS, you cannot use the MODIFY command to change a key field. The RENAME command is what you would need to use. This said, Lennart’s suggestion seems a “cleaner” way of approaching this. Rick
Lennart, Many Thanks. The answer was simple, I had missed one of the primary keys. Dean