Configuring validation error messages for contact creation
If an ABContact instance fails validation, ValidateABContactCreationPluginImpl throws TooLooseContactCreateCriteriaException, which supports a set of display keys based on locale and ABContact subtype.
You can use Guidewire Studio™ for ContactManager to access the set of display keys provided in the base configuration. For example, you can edit the U.S English display key properties file. Navigate in the Project window to and double-click display.properties to open this file in the editor. In the editor, search for TooLooseContactCreateCriteriaException.
There is a set of TooLooseContactCreateCriteriaException
display keys for ABContact
and some of its subtypes. These display keys are accessible in code.
For example:
Java.TooLooseContactCreateCriteriaException.ABCompany
Java.TooLooseContactCreateCriteriaException.ABCompany.ja_JP
Java.TooLooseContactCreateCriteriaException.ABCompanyVendor
Java.TooLooseContactCreateCriteriaException.ABCompanyVendor.ja_JP
For example, an ABContact
that is an ABCompanyVendor
with locale en_US fails
validation. It throws an exception, using for its message the display
key Java.TooLooseContactCreateCriteriaException.ABCompanyVendor.
If the Japanese locale is specified, the exception uses the display key
Java.TooLooseContactCreateCriteriaException.ABCompanyVendor.ja_JP.
Similar behavior applies to ABContact entities that are of
class ABCompany but not
ABCompanyVendor. They
use the Java.TooLooseContactCreateCriteriaException.ABCompany
display keys.
See also
- For general information on working with display keys, see Overview of display keys.
