Start a new topic
Answered

How Can I Generate a Custom UUID as Entity Primary Key?

How do I generate a UUID/GUID in a SemQL formula and/or in an Enricher so I can use it as a default in a record attribute (not for a PRIMARY key generated by Semarchy for an entity...I want to populate a field during record authoring).


Best Answer

You can optionally declare the extensions.uuid_generate_v4() function ALREADY required by Semarchy as a custom database function.  Not declaring the function gives you a warning, but does not cause an errors in the generation of the UUID. Then I invoke that in an enricher with a 'None" scope and fire that enricher on Form load...essentially creating "default" functionality where there was none.

1 Comment

Answer

You can optionally declare the extensions.uuid_generate_v4() function ALREADY required by Semarchy as a custom database function.  Not declaring the function gives you a warning, but does not cause an errors in the generation of the UUID. Then I invoke that in an enricher with a 'None" scope and fire that enricher on Form load...essentially creating "default" functionality where there was none.

Login to post a comment