Announcement

Collapse
No announcement yet.

Custom field type like Phone

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

  • Custom field type like Phone

    Hi,

    I am trying to create new field type like phone / email(multiple add option).

    Do we need to create the relationship table like entity_phone_number at the backend or it is automatically generated with the code?

    If automatic, where can I find the code to create table?

    Please help.

    Thanks.

  • #2
    Hello

    application/Espo/Core/Utils/Database/Orm/Fields/Email.php

    Comment


    • #3
      Hi,

      I got the realtion table o rebuild.

      Field is visible on create but failed to save values to db.

      Giving error => Column not found: 1054 Unknown column 'relationName.name' in 'field list'

      Comment


      • #4
        Hi,

        I copied the same way as application/Espo/Core/Utils/Database/Orm/Fields/Email.php and application/Espo/Core/Utils/Database/Orm/Fields/Phone.php

        I that relation emailAddresses need to define in any other files other than application/Espo/Core/Utils/Database/Orm/Fields/Email.php

        Confused. Please help.

        Thanks.

        Comment


        • #5
          application/Espo/Repositories/EmailAddress.php storeEntityEmailAddress
          and check where does it call

          Comment


          • #6
            Hi,

            Tried to create 2 functions=>

            1. handleListItemParams($params)() in handleSelectParams()

            2. processListItemSave(Entity $entity) () in afterSave() of RDB for the new field type

            Both gives bad server response.
            No call reaches storeEntityListItem

            Please help.

            Comment


            • #7
              Hi,

              It is working now.

              Error was I tried to create them with "notCreatable": false so that they became available in entity manager fields, but giving error on save.
              Any way is there to make phone or email field creatable from the entity manager?

              Please help.
              Thanks.

              Comment


              • #8
                notCreatable ?
                this parameter is used only on client side (client/src/views/admin/field-manager/list.js)
                if you want don't create a column, you need to use notStorable

                Comment


                • #9
                  Hello,
                  What I mean is how can I add phone to Add Field drop down of entity manager? Is that possible?
                  This was what I tried.
                  Click image for larger version

Name:	add field.png
Views:	827
Size:	33.7 KB
ID:	31998

                  Comment


                  • #10
                    This field is better to add manually. To make field type visible, set "notCreatable": true.
                    Don't remember the reason, why these fields were hide, but I'm sure, the reason exists. Better don't make these fields visible in the list

                    Comment


                    • #11
                      Yes Tanya that worked.

                      Comment


                      • #12
                        But we have to use same name phoneNumber for the field, otherwise it will save only first value in the list.

                        Comment


                        • #13
                          Hi,
                          Can we set name of a field automatically by program ?
                          Click image for larger version

Name:	name of field.png
Views:	726
Size:	16.6 KB
ID:	32016

                          Comment


                          • #14
                            client/src/views/admin/field-manager/edit.js
                            search populateDefaults
                            you can set the name in this area

                            Comment


                            • #15
                              Thanks tanya. That worked.

                              Comment

                              Working...
                              X