Enter values in enum and multi-enum fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Exsto
    Member
    • Nov 2018
    • 58

    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
  • yuri
    Member
    • Mar 2014
    • 8440

    #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"
                  ]
             }
        }
    }
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Exsto
      Member
      • Nov 2018
      • 58

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

      Comment

      • Exsto
        Member
        • Nov 2018
        • 58

        #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

        • yuri
          Member
          • Mar 2014
          • 8440

          #5
          Hi,

          Did you clear cache after?

          Style is not needed.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • Exsto
            Member
            • Nov 2018
            • 58

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

            Comment

            Working...