Overriding an existing validation error message
If the error message that displays for a validation error for a Management Center object does not include the details that you want to display, you can change the message text. To change this message, you must add or edit the properties file entry for the validation error message code within your custom resource bundle properties file for the component.
Procedure
- Open IBM WebSphere Commerce Developer.
-
In the Enterprise Explorer view, expand
.
- If the object property that is associated with the validation error message that you want to change is a custom object, expand com.mycompany.commerce.component-ext, where mycompany is the name of your company and component is the name of the component for the object.
- If the object property that is associated with the validation error message that you want to change is provided by default, expand com.ibm.commerce.component-ext, where component is the name of the component for the object.
-
Open the component configuration file.
- If the object property that is associated with the validation error message that you want to change is a custom object, open the wc-component-clientobjects-ext.xml file.
- If the object property that is associated with the validation error message that you want to change is provided by default, open the wc-component-clientobjects.xml file.
-
In the error definition configuration section of the file, identify the validation error reason
code for the object property that maps to the message that you want to change.
The reason code mapping for an object property resembles the following code.
<_config:ReasonCodeParameterAssociation
reasonCode="_ERR_CATENTRY_DUPLICATE_EXTERNAL_IDENTIFIER_FOR_CHANGE"
parameterName="partnumber" /> - Expand . If this directory does not exist, create the directory.
- Open your custom componentLOBErrorMessages.properties and componentLOBErrorMessages_locale.properties files for editing, where locale is the language code, such as en_US. If these files do not exist, create the files. The file name for the base componentLOBErrorMessages.properties file must match the name of the file that is configured as the alternate resource bundle within the wc-component-clientobjects.xml or wc-component-clientobjects-ext.xml file.
-
Locate the properties file entry for the validation error reason code. The entry is in the
format
reasonCode=messageText
. If the entry does not exist in your custom properties file, you must add the entry.For example, the entry for the"_ERR_CATENTRY_DUPLICATE_EXTERNAL_IDENTIFIER_FOR_CHANGE"
reason code resembles the following properties file entry.CatalogEntry._ERR_CATENTRY_DUPLICATE_EXTERNAL_IDENTIFIER_FOR_CHANGE=The specified code is already in use. Type in a new catalog entry code.
- Add or edit the message text for the validation error reason code to match the message that you want to display.
- Save and close the files.