on 2021 Sep 21 2:42 PM
I am trying to update an existing custom attribute to unique=true for an ItemType (ProductReference) which extends GenericItem.
Here the ItemType is ProductReference which is an OOTB item type that is extended from GenericItem.
if I tried to redeclare the attribute getting a build error. redeclare works only when an attribute is defined in the supertype.
items.xml
<itemtype code="ProductReference" autocreate="false" generate="true">
<description>Extending the ProductReference type from core with additional attributes.</description>
<attributes>
<attribute qualifier="attribute1" type="java.lang.String" redeclare="true">
<modifiers read="true" write ="true" search="true" optional="false" unique="true"/>
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
You can either create a sub-type or implement the unique constraint using a validate interceptor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.