Announcement

Collapse
No announcement yet.

Phone field in custom entity

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

  • Phone field in custom entity

    Hi I've created several new entities but I can't add any phone (with the work, home, mobile options...) or email fields in thoses.
    Is there any way to add them?

  • #2
    Hello
    If you create entity with type Company or Person - these fields are included.
    These fields are not available for creation in Entity Manager.
    You can do it only manually.
    use application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json (or Contact.json) as example

    Comment


    • #3
      Thank for your answer.
      Noob here, I juste need to Duplicate the Account.json and rename it by the name of my entity?

      Comment


      • #4
        Just copy this
        Code:
                "emailAddress": {
                    "type": "email"
                },
                "phoneNumber": {
                    "type": "phone",
                    "typeList": ["Office", "Mobile", "Fax", "Other"],
                    "defaultType": "Office"
                },

        Comment


        • #5
          Do not copy all the file, because it contains own relations

          Comment


          • #6
            Here? httpdocs/custom/Espo/Custom/Resources/metadata/clientDefs/site.json (My entity is called Site)

            Edit : My bad here : httpdocs/custom/Espo/Custom/Resources/metadata/entityDefs/site.json

            Comment


            • #7
              /custom/Espo/Custom/Resources/metadata/entityDefs/Site.json

              Comment


              • #8
                Yay works perfectly thanks

                Comment


                • #9
                  I'm trying to do this with Opportunity, I Inserted the code the json file in the custom folder accordingly but the email field is not working.
                  I have cleared the backend cache, my local cache and restarted apache just to make sure to no avail. Not sure what I am missing.

                  "emailAddress": { "type": "email" },
                  Last edited by khopper; 12-15-2017, 04:27 AM.

                  Comment


                  • #10
                    The path of your file? Is json valid? Did you Rebuild EspoCRM in Administration?

                    Comment


                    • khopper
                      khopper commented
                      Editing a comment
                      I did the rebuild and restarted apache. I also had to remove the email field had originally created before finding this post.
                  Working...
                  X