Announcement

Collapse
No announcement yet.

Adding new field to addresses

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

  • MicKress
    replied
    Hi, did you add only the new fileds to the file in custom folder or all adress fields? I have similar topic with person-name. Regards

    Leave a comment:


  • RGF
    replied
    It looks like I handled myself.
    It is necessary to add to the file custom\Espo\Custom\Resources\metadata\fields\addre ss.json some lines:
    PHP Code:
    "actualFields":[
        ...........
        
    "flat",
        
    "house",
        ...........
    ],
    "fields":{
        ...........
        
    "flat":{
        
    "type":"varchar"
        
    },
        
    "house":{
        
    "type":"varchar"
        
    },
        ...........

    ,
    and add some code to client\custom\src\views\fields\address.js like client\src\views\fields\address.js
    Last edited by RGF; 08-11-2016, 07:52 AM.

    Leave a comment:


  • RGF
    replied
    Steps from 1 to 3 to make it possible to change the view (form) of the address.

    But how to add to the Address some fields, such as house, apartment, etc.?

    Leave a comment:


  • yuri
    replied
    See files:
    client/src/views/fields/address.js
    client/res/templates/fields/address/*

    For experienced developer:

    1. Need to add view parameter to metadata "fields.address"
    Create file custom/Espo/Custom/Resources/metadata/fields/address.json
    PHP Code:
    {
      
    "view""Custom:Fields.Address"


    2. Extend existing address field view. Create file client/custom/src/views/fields/address.js

    PHP Code:
    Espo.define('Custom:Views.Fields.Address''Views.Fields.Address', function (Dep) {
     
     
    detailTemplate'custom:fields.address.detail',

     
    editTemplate'custom:fields.address.edit',

    ... 
    OVERRIDEN METHODS ...

    }); 
    3. Create files:
    client/custom/res/templates/fields/address/detail.tpl
    client/custom/res/templates/fields/address/edit.tpl

    Leave a comment:


  • ConsultMe
    started a topic Adding new field to addresses

    Adding new field to addresses

    The single street address field provided by default is not adequate for our addressing needs so I'm looking to add a second street address field.

    It's easy enough to create the text field in Accounts, but what I cannot see is how to associate that with the aggregate fields "billingAddress" or "shippingAddress" - where do I add my new field to the these?

    Thanks
    Andrew
Working...
X