Is that the red dot item ? How did you find it ?
I checked shalmaxb posted code with Notepad++ and could not reproduce the error
I also checked on my installation and I have an entityDefs file like this, working without any problems
"startingDate": {
"type": "datetime",
"validationList": [],
"mandatoryValidationList": []
},
"endingDate": {
"type": "datetime",
"validationList": [],
"mandatoryValidationList": []
},
"firstExecutionDate": {
"type": "datetime",
"validationList": [],
"mandatoryValidationList": []
},
How to disable back end field validation to avoid the "Field Validation" error
Collapse
X
-
Hi,
thank you for your offer telecastg.
Here is the field, that needs to bypass the validation:
but still on rebuild I get a json code error, which is not there, when I rebuild without the two lines. Version espoCRM is now 7.3.4Code:"shippingCost": { "tooltip": true, "default": 10, "onlyDefaultCurrency": false, "conversionDisabled": false, "validationList": [], "mandatoryValidationList": [] },Leave a comment:
-
If it doesn't work, try checking the entitDefs custom script with your development platform/ editor to see if it detects any json structure errors. I use Eclipse from Apache and it will highlight json structure errors.
Another option (just for you friend, because you always help everyone
), post the code from 'custom/Espo/Custom/Resources/metadata/entityDefs/Quote.json' and I will take a look too.
-
The field is a currency field (built in into sales extension) and is not in use from my client. But it seems, this code does not work for that field. I do not see any jsn error, though it is thrown.
This is the error in the log file:
[2023-03-10 07:03:01] ERROR: Uncaught Exception JsonException: "JSON syntax error in 'custom/Espo/Custom/Resources/metadata/entityDefs/Quote.json'." at /var/www/espocrm/application/Espo/Core/Utils/File/Unifier.php line 250 {"exception":"[object] (JsonException(code: 0): JSON syntax error in 'custom/Espo/Custom/Resources/metadata/entityDefs/Quote.json'. at /var/www/espocrm/application/Espo/Core/Utils/File/Unifier.php:250)"} [] -
How to disable back end field validation to avoid the "Field Validation" error
Sometimes, for whatever reason, it is preferred to bypass Espo's built in field validation rules to avoid triggering the "Field Validation Error" message and interrupting the back end program flow.
Fortunately, this is now possible using metadata settings, so it is not necessary to do any coding to accomplish this.
Simply add these two parameters in your custom entity entityDefs json file under the field for which you want to bypass all validations:
Code:"validationList": [], "mandatoryValidationList": []
For participants that do not mind writing code, the documentation https://docs.espocrm.com/development...validationlist has information on how to define and invoke custom back end validations in case this is the preferred solution.Tags: None

Leave a comment: