
I have created a custom module for a kind of form builder. It is configured with an array of fields pointing to a definition in the config file. Within the definition of the objects, I'd like to only show the options config when the inputType matches certain values. Config like the example below following builds, runs, and works successfully with mock data, but on deployment the dependent config option doesn't show. I tried putting the dependent schema inside the definition, but that didn't build. Is what I'm trying to do possible?
"config": {
"heading": {
"friendlyName": "Heading",
"description": "Module heading",
"$ref": "@msdyn365-commerce-modules/definitions/dist/src/Heading.json#/definitions/heading"
},
"fields": {
"type": "array",
"friendlyName": "Form fields",
"description": "Form fields to show",
"items": {
"$ref": "#/definitions/formField"
}
}
},
"definitions": {
"formField": {
"type": "object",
"friendlyName": "Form field",
"description": "HTML form field",
"properties": {
"name": {
"type": "string",
"friendlyName": "Name",
"description": "Name of the input",
"required": true
},
"inputType": {
"type": "string",
"friendlyName": "Type of control",
"description": "HTML input type to render",
"enum": {
"text": "Text box",
"textarea": "Text area",
"select": "Dropdown list",
"radio": "Radio button list",
"checkbox": "Checkbox"
},
"default": "text",
"required": true
}
}
}
},
"dependentSchemas": {
"inputType": {
"oneOf": [
{
"properties": {
"inputType": {
"enum": {
"select": "Dropdown list",
"radio": "Radio button list"
}
},
"options": {
"type": "array",
"friendlyName": "Options",
"description": "Options to select from",
"items": {
"type": "string"
}
}
}
}
]
}
},
I've been looking at https://learn.microsoft.com/en-us/dynamics365/commerce/e-commerce-extensibility/configure-properties-context for help, but the text and examples seem to be mixed up.
Hi,
I will leave it for the community to answer. Let's see if anybody has experienced the same and can advise for you anything.