Unique field error

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • theBuzzyCoder
    replied
    Yes, you can. The info I gave you was just a guide, not the solution. You've to think about how you can make it work.

    you cannot create a field without the type.

    custom/Espo/Custom/Resources/metadata/entityDefs/<your-entity>.json

    substitute <your-entity> with right value. If the vat field is in Lead then <your-entity> is Lead, so your file will be custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json


    Code:
    {
      "fields": {
         "vat": {
           "type": "varchar",
           "maxLength": 255,
           "notNull": true,
           "trim": true,
           "required": true,
           "readOnly": false,
           "unique": true
        }
      }
    }
    Then from your EspoCRM website, go to EspoCRM Administration > Label Manager > Lead > fields and update the vat fields label.

    Leave a comment:


  • Exsto
    replied
    Could anyone help me?
    Thanks

    Leave a comment:


  • Exsto
    started a topic Unique field error

    Unique field error

    Hi, I would like to make the VAT and fiscal code fields unique, the fields must be varchar. It's possible to do it?
    I tried this:

    Originally posted by theBuzzyCoder

    One can add
    Code:
    {
    "fields": {
    "fieldName": {
    "unique": true
    }
    }
    }
    in metadata.entityDefs.Entity.json under fields.fieldName
    But, when I save a database error.
    Any suggestions?

    Thank you​​​​​​
Working...