Announcement

Collapse
No announcement yet.

Enter values in enum and multi-enum fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enter values in enum and multi-enum fields

    Hello,
    I have to insert many values in some enum and multi-enum fields. Is there a way to insert them quickly? Even by intervening at the code level?
    Thank you

  • #2
    Hi,

    custom/Espo/Custom/Resources/metadata/entityDefs/YourEntityType.json

    You can add json array for your enum/multi-enum fields.

    Code:
    {
        "fields": {
             "yourField": {
                  options": [
                      "v1",
                      "v2"
                  ]
             }
        }
    }

    Comment


    • #3
      Perfect, thank you so much you are very efficient.

      Comment


      • #4
        hello, I added 3 values to do tests, then I try to insert other values from the code but they are not written.
        This is the code that I find myself.
        Code:
        {
            "fields": {
                "industry": {
                    "options": [
                        "",
                        "val1",
                        "val2",
                        "val3"
                   ],
                    "style": {
                        "": null,
                        "val1": null,
                        "val2": null,
                        "val3": null
                    }
                }
          }
        }
        I tried to add the new values on both options and style, but nothing.
        How can I solve it?
        Thanks for the attention
        Greetings

        Comment


        • #5
          Hi,

          Did you clear cache after?

          Style is not needed.

          Comment


          • #6
            Hi,
            ok it works fine, I didn't know I had to clear the cache :-).
            Thank you

            Comment

            Working...
            X