Leave a comment at the end of this page or email contact@krishagni.com
How to solve error 'Error: FormException:Invalid control name: quality (COMMON_SERVER_ERROR)'
What does this error mean?
This error means the system can't find a field named quality in the custom form. It's usually due to a mismatch between the field name used in the JSON and the actual field name in the form.
Why does it happen?
The field name (controlName) in the JSON is incorrect.
The form field has been modified or renamed, but the JSON wasn’t updated.
How to fix it?
Download the form XML (Refer wiki page to export the form XML) and find the correct variable name for the field (e.g., specimen_quality).
Update the JSON with the correct controlName => "controlName": "specimen_quality" instead of quality.
Correct JSON Code:
{
"name": "specimen.extensionDetail.attrsMap.quality specimen_quality",
"caption": "Specimen Quality",
"type": "dropdown",
"listSource" : {
"apiUrl" : "forms/permissible-values",
"selectProp" : "value",
"displayProp" : "value",
"queryParams" : {
"dynamic" : { },
"static" : {
"formName" : "unplanned_specimen_custom_field",
"controlName" : "quality specimen_quality"
}
}
}
}
How to avoid it in the future?
Always copy the exact variable name from the form XML.
Update JSON/configs if the form changes.
Refer to the JSON custom field Wiki for correct examples.
Leave a comment at the end of this page or email contact@krishagni.com