How to create enum field with options will be load from other entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tapnm
    Junior Member
    • Aug 2022
    • 11

    How to create enum field with options will be load from other entity

    How to create enum field with options will be load from other entity
  • lazovic
    Super Moderator
    • Jan 2022
    • 810

    #2
    Hi tapnm,

    Let me clarify, do you want an enum field to be copied to another entity with all values?

    That is, in entity A, we enter the values ​​1, 2, 3 (for example) in the Enum type field. And these values (1, 2, 3) are copied into a field of type Enum entity B?

    If I misunderstood you, please explain in a little more detail or even attach a schematic screenshot so we can understand what functionality you are looking for and help you faster.​

    Comment

    • tapnm
      Junior Member
      • Aug 2022
      • 11

      #3
      Originally posted by lazovic
      Hi tapnm,

      Let me clarify, do you want an enum field to be copied to another entity with all values?

      That is, in entity A, we enter the values ​​1, 2, 3 (for example) in the Enum type field. And these values (1, 2, 3) are copied into a field of type Enum entity B?

      If I misunderstood you, please explain in a little more detail or even attach a schematic screenshot so we can understand what functionality you are looking for and help you faster.​

      I mean,

      I have an entity A there are code and name field (code and name are varchar type). I will insert data into that (Example: (code, name) values ( (1, A),(2, B), (3,C)))

      After that I have entity B and i want to create X field with enum type then options of X field will be load from data of entity A. Value of option get from code field of entity A, text of option get from name field of entity A

      Comment

      • item
        Active Community Member
        • Mar 2017
        • 1476

        #4
        Hi,
        maybe :
        in entityDefs/Lead.json

        PHP Code:
                "industry": {
                    "type": "enum",
                    "view": "crm:views/lead/fields/industry",
                    "customizationOptionsDisabled": true,
                    "optionsPath": "entityDefs.Account.fields.industry.options",
                    "translation": "Account.options.industry",
                    "default": "",
                    "isSorted": true
                },
        If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

        Comment

        Working...