Uniqueness of a field

Hello!

What is the best way to keep some CDT field unique? It will be a constraint in the database, but the database error message is not user friendly.

I can set it up as a query rule or expression and validate manually in the interface. In this case the designer should remember what fields have to be validated.

May be there is an easier and straightforward way to achieve it?

OriginalPostID-273384

  Discussion posts and replies are publicly visible

Parents
  • Two possible ways:
    1) Add a validation which checks by querying database if the entered value already exists in DB. Problem is that another user could enter the same value at this time and the check would be OK for both.

    2) Directly write the data to DB in the saveInto (a!writeToDatastoreEntity()) and react on failure/success of the operation. This way two users cannot enter the same value at the same time.
Reply
  • Two possible ways:
    1) Add a validation which checks by querying database if the entered value already exists in DB. Problem is that another user could enter the same value at this time and the check would be OK for both.

    2) Directly write the data to DB in the saveInto (a!writeToDatastoreEntity()) and react on failure/success of the operation. This way two users cannot enter the same value at the same time.
Children
No Data