How to disable back end field validation to avoid the "Field Validation" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • rabii
    commented on 's reply
    me too i have tried it and it worked. definitely some issue with json file.

  • shalmaxb
    commented on 's reply
    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)"} []

  • telecastg
    commented on 's reply
    hello shalmaxb I tried with just the brackets and it worked fine, maybe it has something to do with the entityDefs json structure ?

  • shalmaxb
    replied
    telecastg
    I tried to use this code for one field, but I get a json error (wrong code). It might be because of the [ ]. Has there to be any value? Or just leaving the brackets?
    Thank you in advance.

    Leave a comment:


  • telecastg
    commented on 's reply
    You're very welcome rabii

  • rabii
    replied
    thanks for sharing.

    Leave a comment:


  • 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.
Working...