I have a validator function with the "async" flag set to true. It is working however the error message is not showing when the record is saved and the validation fails.
viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[
{
"operation": "merge",
"path": [
"attributes"
],
"values": {
"UsrCaptainReportsTo": {
"modelConfig": {
"path": "UsrYachtsDS.UsrCaptainReportsTo"
},
"validators": {
"CaptainReportsTo": {
"type": "usr.CaptainReportsTo",
"params": {
"message": "'Captain reports to' must be an affiliate in the yacht's affiliates list."
}
}
}
},
validators: /**SCHEMA_VALIDATORS*/{
"usr.CaptainReportsTo": {
"validator": function (config) {
return async function (control) {
var validated;
validated = false;
//debugger;
return validated ? null : { "usr.CaptainReportsTo": { message: config.message } };
};
},
"params": [
{
"name": "message"
}
],
"async": true
}
}/**SCHEMA_VALIDATORS*/