Validation message for unique constraint

Hi,

I’m looking for a possible way to change the message of an validation error caused by UNIQUE CONSTRAINTS. I tried to add into messages.properties the name of the unique constraint, but no changes.

The message I’m getting is : "Unique constraint violation occurred (IDX_MYPROJECT_ENTITIY_UNQ)"
Any idea

Please look at this topic: Unique Index Custom Exception Handler - CUBA.Platform

If using the cuba.uniqueConstraintViolationPattern app property doesn’t help, try to debug the UniqueConstraintViolationHandler class to find out the reason.

Great, thanks for your help!

For others who are having issues showing cuba.uniqueConstraintViolationPattern then you should put message into module/web/src/com.your.package/web/messages.properties as MYAPP.IDX_MYAPP_ENTITY_UNQ = Your message assuming that IDX_MYAPP_ENTITY_UNQ is your unique constraint id.

Hope this could help.

What should be the value for

MYAPP

in MYAPP.IDX_MYAPP_ENTITY_UNQ

It should be the name of your app.