Question
I want the followed nested attribute to be required and a validation message to appear when it is missing.
"label": "Country",
"name": "Country",
"description": "Country",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": true,
"faceted": true,
"searchable": true,
"attributeOrdering": {
"orderType": "ASC",
"orderingStrategy": "LUD"
},
"cardinality": {
"maxValue": 1
},
Answer
- You need to add the following parameter to the entity in your L3 configuration.
"uri": "configuration/entityTypes/HCP",
"validateRequiredAttributes": true,
"label": "HCP",
"description": "Health care provider",
"typeColor": "#99CCFF",
- If you see that the validation is firing for all of the nested attributes rather than just the required sub-attribute, you need to add doNotTakeRequiredFromSubnested as true.
Example
If the sub-nested attribute has the required flag set to true and the nested attribute has the required flag set to false, then the request will not contain the nested attribute, and an error message saying that the nested attributes are required is not displayed. But, if the nested attribute has the required flag set to true, then an error message saying that the sub-nested attributes are required is displayed.
Before the doNotTakeRequiredFromSubnested flag was added to the tenant configuration, the error message saying that the nested attributes are required was always displayed when the sub-nested attribute has the required flag set to true and the nested attribute has the required flag set to false. I will need your approval to modify the doNotTakeRequiredFromSubnested flag in the physical tenant configuration. To modify the doNotTakeRequiredFromSubnested flag, please create a Support ticket.
Comments
Please sign in to leave a comment.