cancel
Showing results for 
Search instead for 
Did you mean: 

how to validate the maxLength restriction

Former Member
0 Kudos

I have added the new attribute maxLength in ClassificationAttribute Item type I need to Validate if product is part of classifying attribute and the classification attribute length restriction. In Details: - Invoke the custom validation service: CustomAttributeValidationService. If the product is part of classification attributeassignment for that attribute, fetch the maxLength attribute from ClassificationAttribute and validate with the input attribute. - If the input attribute length field exceeds the maxLength attribute, throw custom exception CustomAttributeLengthException with appropriate message. Please any one help me on this

former_member620692
Active Contributor
0 Kudos

As far as I can understand your problem, you can achieve it by writing a Validate Interceptor on Product. Have you already tried it or you want to solve a different problem which I am not getting?

Former Member
0 Kudos

yes, I want to write the validate interceptor on product but my question is how to compare the maxLength attribute (Classification attribute ) .

Details :If the input attribute length field exceeds the maxLength attribute, throw custom exception CustomAttributeLengthException with appropriate message

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member1320010
Participant
0 Kudos

if you want a full blown validation you could check this the validationCoverageCalculationStrategy. However here you don't have to maintain the maxLength at the item itself , it will move in as AttributeConstraint