I have UUID field in my record that needs to be unique for each record.
It has a Formula:
?(uuid = “”,info(“guid”),uuid)
When I duplicate a record, as expected the UUID gets duplicated as well. So I have to go into the field, delete the UUID contents and then press return so that a new UUID gets created.
Is it possible to get this to happen automatically on a record duplicate?
One approach would be to create your own special duplicate procedure using copyrecord, pasterecord, followed by your uuid field assignment using your formula.
Here is the code that Panorama uses to duplicate a record.
unlockrecord
if info("summary")>0
// beep
nsnotify "Cannot duplicate record","TEXT","Summary records cannot be duplicated."
return
endif
let r = exportline()
insertbelow
importline r
You would need to make your own procedure with similar code, then add the code to generate the UUID field af the end.
It’s a bit involved to set up, but you can even customize the menus so that Panorama will run your custom procedure when the Records>Duplicate Record command is chosen.