Removing a validation rule
You can remove a validation rule from the Management Center user interface. For example, you can change a required field into an optional field.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Expand , where component is the name of the Management Center component.
- Open the object definition file that includes the validation rule that you want to remove.
-
Locate and delete the validation rule from the object definition. Validation rules can be
specified in three ways, which are removed differently.
- A validation rule can be specified by including one of the following property definition
attributes:
maximumSizemaxValueminValuerequiredtype
- A validation rule can be specified by declaring a definition element that extends the validator
definition as a child element of a
PropertyDefinitionelement. To remove this type of validation rule, delete the validator declaration. For example, in the following code snippet the code<NoSpacesValidator package="ext"/>must be deleted to remove the validation rule.<PropertyDefinition displayName="${catalogResources.categoryCode_DisplayName}" propertyName="identifier" type="string" required="true" maximumSize="254"><NoSpacesValidator package="ext"/></PropertyDefinition> - A validation rule can also be specified by declaring a definition element that extends the
Validatorclass definition as a child element of an object definition. To remove this type of validation rule, delete the validator declaration. For example, in the following code snippet, the code elementUniqueValueForChildObjectPropertyValidatorthat has the definition name"cmc/catalog/OfferPriceMinimumQuantityUniquenessValidator"must be deleted to remove the validation rule.<Definitions> <ReferenceObjectDefinition copyProtected="false" definitionName="cmc/catalog/BaseAttachmentReference" displayName="${catalogResources.catalogAttachmentReference_DisplayName}" idProperty="attachmentRefId" isBaseDefinition="true"> ... <!--- This is a validator definition to validate that the minimum quantity values for offer prices are unique. --><UniqueValueForChildObjectPropertyValidator definitionName="cmc/catalog/OfferPriceMinimumQuantityUniquenessValidator" errorMessage="${catalogResources.offerPriceMinimumQuantityUniquenessWarning}" objectPath="CatalogEntryOffer" propertyName="minimumQuantity" validatorId="offerPriceMinimumQuantityUniquenessValidator"> <dependency localName="catalogResources" moduleName="cmc/catalog/CatalogResources"/> </UniqueValueForChildObjectPropertyValidator>... </Definitions>
- Save and publish your changes.
- A validation rule can be specified by including one of the following property definition
attributes: