Making email and phone Field Types Available in Entity Manager – Any Risks?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IshitaRana
    Junior Member
    • Apr 2025
    • 8

    #1

    Making email and phone Field Types Available in Entity Manager – Any Risks?

    Hi,

    I was recently trying to add email and phone fields via the Entity Manager in EspoCRM, but noticed that they were not appearing in the field type dropdown list.

    After some digging, I found that this was because these field types have "notCreatable": true defined in their respective metadata JSON files (email.json and phone.json under application/Espo/Resources/metadata/fields).

    To make them available in the UI, I created override files at:

    custom/Espo/Custom/Resources/metadata/fields/email.json
    custom/Espo/Custom/Resources/metadata/fields/phone.json


    With the following content:

    HTML Code:
    { "notCreatable": false }
    After clearing cache and rebuilding, the field types are now showing up as expected in the dropdown when adding fields.

    Before I proceed further with using this in production, I wanted to ask:
    • Are there any potential issues or side effects this change could cause down the line?
    • Why are these fields not creatable by default — is it due to internal limitations, relationships, or design considerations?

    Would appreciate any insights or best practices from others who may have explored or overridden this before.

    Thanks!

    Click image for larger version  Name:	image.png Views:	0 Size:	20.2 KB ID:	118745
    Attached Files
    Last edited by IshitaRana; Today, 09:29 AM.
  • yuri
    Member
    • Mar 2014
    • 9060

    #2
    Hi,

    Unfortunately, it won't work properly. Phone and Email number fields are designed to be as single fields in an entity.
    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

    • IshitaRana
      Junior Member
      • Apr 2025
      • 8

      #3
      Thanks for the clarification!

      In my case, the requirement is to have multiple phone and email fields (e.g., Work Email, Personal Email, Emergency Phone, etc.) on a single entity.

      I understand that the default email and phone fields are designed as single-use and not intended for duplication. But given this business need, could you please advise on the recommended approach for the same.

      Comment

      • yuri
        Member
        • Mar 2014
        • 9060

        #4
        Storing phone numbers in the default Phone field. It's possible to add custom phone types for a particular Phone field. Entity Manager > {Entity} > Fields > Phone.

        For emails, maybe using a varchar field with the view set to "views/fields/email-address" (in entityDefs > fields).
        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

        Working...