Customizing default business component error messages
ADF business components allow you to customize default business component error messages, such as unique constraint violation or foreign key constraint violation, by providing an alternative message string for the error code in a custom message bundle.
The following example will help you to understand the steps for customizing the message bundle used by business components. In this example, we will override the default error message displayed for the violation of the unique constraint 'EMP_EMAIL_UK'
defined on the Email
field in the Employee
table. By default, when you commit a transaction with a duplicate Email
field, the error message thrown by the application is as follows:
"ORA-00001: unique constraint (HR.EMP_EMAIL_UK) violated"
This does not make any sense to an end user and he or she cannot judge anything from this error. Let us see how to convert this error in to more user friendly message:
"Email is in use"