The Design tab of a Schema lets you specify if a field can have a single value or multiple values. But by editing the Schema source, you can also specify a minimum and/or maximum allowed number of values.
Procedure
- In a Schema dialog, access the Source tab.
You see XML containing a number of xsd:element elements with a name attribute set to the XML name of one of your field, and attributes minOccurs and maxOccurs set to one of the following values:
minOccurs is set to 0 (optional field) or 1 (mandatory field).
maxOccurs is set to 1 (single-value field) or unbounded (multivalue field).
- To enforce a minimum number of values (other than 1) for a field, set the
minOccurs attribute of its element to that number.
- To enforce a maximum number of values (other than 1) for a field, set the
maxOccurs attribute of its element to that number.
- Save and close the Schema.
Results
Items based on this Schema now can only be saved if the field has at least the amount of values specified in
minOccurs, and no more values than specified in
maxOccurs. For example, a Component link field with its
minOccurs set to 3 and its
maxOccurs set to 5 means that an item based on this Schema can only be saved if it contains 3, 4 or 5 Component links.