Announcement

Collapse
No announcement yet.

So, anyways, could I have Adding Custom Field to Address Field Type For Dummies???

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

  • So, anyways, could I have Adding Custom Field to Address Field Type For Dummies???

    Search whole way through this forum, you just recommends to have a look at files detail.tpl and address.js. And another moment - I haven't got a another file you mentioned in /metadata folder, maybe it is because of my RealEstate Extension.
    So how I supposed to add "House Number" field for example or "Flat Number"? We are developing real estate agency site on your CMS, and we really need this fields.
    And I also want to link this fields with autocomplete .js script. Could you help?

  • #2
    Hi,

    application/Espo/Resources/metadata/fields/address.json

    If you add new field there it will be created in database.

    Comment


    • #3
      Originally posted by yurikuzn View Post
      Hi,

      application/Espo/Resources/metadata/fields/address.json

      If you add new field there it will be created in database.
      Wow, great! Thank you so much, Yuri!!!
      Could you answer two more questions, please?
      When update will happen this custom fields will be deleted?
      And another one - could you explain from position of developer, how it could be done right.
      I need to add field into address which will be linked with autocomplete.js and will be filling all other adress fields.
      Do I need to write my own custom module or it could be done by just adding new fields?

      Comment


      • #4
        Now, when I add two more fields "housenum" and "flatnum" in address.json ESPO throwing an error 500:SQLSTATE[42S22]: Column not found: 1054 Unknown column 'real_estate_property.address_house_number' in 'field_list'.
        PHP Code:
        {
           
        "actualFields":[
              
        "street",
              
        "city",
              
        "state",
              
        "country",
              
        "postalCode",
              
        "housenum",
              
        "flatnum"
           
        ],
           
        "fields":{
              
        "street":{
                  
        "type""text",
                  
        "maxLength"255,
                  
        "dbType""varchar"
              
        },
              
        "city":{
                 
        "type":"varchar"
              
        },
              
        "state":{
                 
        "type":"varchar"
              
        },
              
        "country":{
                 
        "type":"varchar"
              
        },
             
        "housenum":{
                 
        "type":"varchar"
              
        },
              
        "flatnum":{
                 
        "type":"varchar"
              
        },
              
        "postalCode":{
                 
        "type":"varchar"
              
        },
              
        "map": {
                 
        "type""map",
                 
        "notStorable"true,
                 
        "readOnly"true,
                 
        "layoutListDisabled"true,
                 
        "provider""Google",
                 
        "height"300
              
        }
           },
           
        "notMergeable":true,
           
        "notCreatable"false,
           
        "filter"true,
           
        "fieldDefs":{
              
        "skipOrmDefs":true
           
        }


        Comment


        • #5
          After rebuild.php everything works fine!
          Could you answer this?

          Originally posted by Makov View Post
          When update will happen this custom fields will be deleted?
          And another one - could you explain from position of developer, how it could be done right.
          I need to add field into address which will be linked with autocomplete.js and will be filling all other adress fields.
          Do I need to write my own custom module or it could be done by just adding new fields?

          Comment


          • #6
            And I can't save it properly...saving message appears and nothing happens. I've tried to modify address.js
            Here it is.

            Comment


            • #7
              Now after after a few modding address.js it saves BUT after several reloads it dissapears!!!!! What can be wrong?

              Comment


              • Binh217
                Binh217 commented
                Editing a comment
                Hi Makov!
                I really need your help.how can i contact you? (i don't see pm in the forum)
                my email(phanthanhbinhgsm@gmail.com)

            • #8
              Hi Makov !
              I really need your help.how can i contact you? (i don't see pm in the forum)
              my email.
              phanthanhbinhgsm@gmail.com.

              p/s
              sorry Admin,mod !

              Thanks for the help!

              Comment

              Working...
              X