What's the best way to make a custom auto sequence?

I have existing tables that have character type columns with unique, auto generated values. Some of the existing values contain characters, so I can’t change the column type to integer. Servoy sequence does not work properly if the field is character type. Servoy auto-enter properties do not allow functions to generate the values. The onRecordInsert and afterRecordInsert events don’t seem to fire functions assigned to them (at least they don’t show up as running in debug mode or run application.output in script). I can put a function in a calculation, but that will get performed whenever the record is accessed, not just when created. I can do it in code whenever a newRecord is performed on the tables, but them I have to remember to put the code wherever records are added to the table, and that’s not a good practice. I’m running 5.01. Anybody else having this problem?

We started of with just 1 global method which handles all our ‘new record’ logic.
This method also handles to set the pk with a UUID value.

Meanwhile Servoy also added an UUID-type sequence possibility, I think this is what can help you?

[attachment=0]uuid.jpg[/attachment]

Thanks. But the field already exists as a character field 10 bytes in length, and the existing data in this column is related to other tables.