Improve "duplicate key value" error messages

Description

Hi,

When you try to save a record and it breaks a database constraint rule, error message displayed to the customer is very technical.
Take following message when trying to save a duplicate search key for a BP as an example:

Could not save record - Require unique data: - Please change information.: ERROR: duplicate key value violates unique constraint "c_bpartner_value" Detail: Key (ad_client_id, value)=(11, Tom) already exists.

It would be good to display a more meaningful message to end users who probably are not so technical people.
More user friendly message would be "You can not have two BP with same Search Key".

Regards,
Naim

Environment

None

Activity

Show:

Carlos Ruiz April 17, 2015 at 10:50 PM

closing as duplicate as solution is implemented with

Naim Berisha June 6, 2013 at 4:03 AM

Hi Carlos,

I missed that ticket.
I did tests in local repository, and solution done improves a lot error msgs displayed to end user.

In order to display meaningful msg to user I used following value for AD_message:

DBExecuteError:ORA-00001: unique constraint (ADEMPIERE361.C_BPARTNER_VALUE) violated

which I think with a regexp can be simplified by extracting only constraint name, and use it as value of Ad_message, thus making it not dependent from schema name.

regards,
Naim

Carlos Ruiz June 5, 2013 at 8:08 PM

Naim, that's the intention of ticket IDEMPIERE-805.

Regards,

Carlos Ruiz

Duplicate

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created June 5, 2013 at 4:39 PM
Updated June 1, 2015 at 3:50 PM
Resolved April 17, 2015 at 10:50 PM