Announcement

Collapse
No announcement yet.

Address Format

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

  • c.binder
    replied
    Thanks for your support - now it's working as expected!

    Leave a comment:


  • yuri
    replied
    You can specify custom view name in entityDefs and then create view class in custom directory that will inherit existing view class.

    Leave a comment:


  • c.binder
    replied
    Do you suggest to change the file client/modules/crm/src/views/account/fields/shipping-address.js?

    Originally:
    Code:
    ...
    Espo.define('Crm:Views.Account.Fields.ShippingAddress', 'Views.Fields.Address', function (Dep) {
    ...
    Changed:
    Code:
    ...
    Espo.define('Crm:Views.Account.Fields.ShippingAddress', '[B]Custom:[/B]Views.Fields.Address', function (Dep) {
    ...
    This works but I guess that with one of the next patches this change might be overwritten, right?

    Would be great if you can provide the information where to put this to be upgrade safe...
    Last edited by c.binder; 04-12-2016, 09:59 AM.

    Leave a comment:


  • yuri
    replied
    You can make shipping address to look to custom.

    Leave a comment:


  • c.binder
    replied
    I did all the changes mentioned above and detected that this affects the billing address but didn't change the shipping address.

    There is a file (client/modules/crm/src/views/account/fields/shipping-address.js) that adds the button "Copy from Billing Address" to the view and it's based on Views.Fields.Address (but not on the custom view).

    Therefore, how to change this (upgrade safe) so that the shipping address is based on the custom view?

    Leave a comment:


  • yuri
    replied
    Create:

    1. custom/Espo/Custom/Resources/metadata/fields/address.json
    PHP Code:
    {
       
    "view""custom:views/fields/address"


    2. client/custom/src/views/fields/address.js
    PHP Code:
    Espo.define('custom:views/fields/address''views/fields/address', function (Dep) {
      return 
    Dep.extend({
         
    editTemplate'custom:fields/address/edit'
      
    });
    }); 

    3. Create client/custom/res/templates/fields/address/edit.tpl

    I didn't test but I believe everything is correct.

    BTW in 3.7.0 address string for detail view is generated in javascript function.

    Leave a comment:


  • iscon
    started a topic Address Format

    Address Format

    I changed

    /client/src/views/fields/address.js and
    /client/res/templates/fields/address/edit.tpl

    in order to edit/show addresses in the correct format for Germany/Austria/Switzerland. How can this be made upgrade safe?
Working...
X