Weird thing is that this way it creates 2 new records in the db, while if I remove the setIsNewRecord line it updates last record without inserting anything.
Hi, thanks for your answer. Honestly I thought cloning was a more elegant way, I tried this way and I get validation errors (non sense to me: why don’t I get same errors with cloning?).
Because cloning won’t trigger validation. Alos, you’re also cloning the primary key, so the db won’t assign a new one. If you get a lot of validation errors by the method above, perhaps you could create a new scenario that will declare all attributes except for the pk to be safe?