Attach a message to a Unique Constraint violation

Instead of receiving this error message


It would be nice if we could attach a message to appear if this constraint triggers a violation.

Hello, @JohnM!

Yes, you can do this! :wink:

For this, the main message pack should contain keys equal to constraint names. For example:

IDX_SEC_USER_UNIQ_LOGIN = A user with the same login already exists

Please, see property cuba.uniqueConstraintViolationPattern in documentation if need.

1 Like

They think of everything.

Thanks for the information.