Change Data Key Field

I need to update several fields in a record. One field is a part of the primary key. I am using one “GET” operation to retrieve the record followed by a “MODIFY” operation to change the non-key fields, followed by a “RENAME” operation to change the field which is a part of the primary key. Is this the correct and best way to change all of these fields?

It sems to me, that the best way is “GET”, “delete” then assign the new values of fields you need, and “Insert” at last. As I tested it works faster then “Rename”.

The RENAME is probably the easiest as it is a little less code. In the end, it is just deleting the old record from the Flowfield calculations and inserting it in the new ones…The speed should be similar on both.

The difference between “GET,DELETE,INSERT” and “RENAME” is that fields in other tables, which have a relation to the keyfields of the record you update wouldn’t be updated with the new values of your record when you use the first method. If you use the “RENAME”-method, the performance is worse, but you still have consistend data.