Whats Up with Field Type "phone" ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • czcpf
    Senior Member
    • Aug 2022
    • 160

    Whats Up with Field Type "phone" ?

    Hello,

    I have an entity and I wanted to add a field of type "phone" to it. Everything works on the front-end. I can type the phone number into the field and when I save the entity it shows 'success' on the front-end and displays the phone number. For some reason, it isn't saving it on the backend.

    Refreshing the page shows that the field is empty again and it isn't storing it in the phone_number table in the database either. I seem to have had this issue before but I can't remember how I fixed it. Yes, I have cleared the cache and rebuilt after adding this field to my entity.

    I could have sworn that the way I fixed this some time ago was by 'naming' the field 'phoneNumber' but I can't do that here because I need two different fields of type 'phone'.

    I've added the field to myEntity.json as shown below (Using Espo 7.2.7)

    /Custom/Resources/metadata/EntityDefs/MyEntity.json

    Code:
    {
        "fields": {​
            ...,
            "shippingAddressPhone": {
                "isCustom": true,
                "type": "phone",
                "required": false,
                "typeList": [
                    "Office"
                ],
                "defaultType": "Office"
            }​
        }
    }
  • Kharg
    Senior Member
    • Jun 2021
    • 410

    #2
    Hello,

    the field has to be named "phoneNumber" for it to work.

    Maybe you could try to change the type and assign the phone view or just use the phone view with the current field type, but I don't really know if it will work
    view": "views/fields/phone"

    Similar issue for reference: https://forum.espocrm.com/forum/feat...ail-field-type
    Last edited by Kharg; 01-13-2023, 02:37 AM.

    Comment


    • czcpf
      czcpf commented
      Editing a comment
      Well that's unfortunate. Thanks for the feedback
      Last edited by czcpf; 02-17-2023, 05:55 PM.
Working...