No announcement yet.

B2C mode and two addresses

  • Filter
  • Time
  • Show
Clear All
new posts

  • B2C mode and two addresses


    I'm new to EspoCRM, so i'm just learning how things done here.

    I've found man page about how to change EspoCRM from B2B mode to B2C mode:
    And there is one problem for me. Accounts (which are organizations in B2B model as I understand) have two Address fields - Billing Address and Shipping Address.
    But Contacts (which are individual customers in B2C model) have only one Address.
    So, is it possible for Contacts to also have two Address fields - Billing Address and Shipping Address? And if it's possible - how to make it?

  • #2

    You can add it: Administration > Entity Manager > Contact > Fields > Add Field > Address
    Name it "shippingAddress"

    Then put it on Detail Layout in Layout Manager.


    • #3

      And how to get "Copy Billing" button here (in Contact) too?
      I see it in client/modules/crm/src/views/account/fields/shipping-address.js file, but simple copying it to client/modules/crm/src/views/contact/fields does nothing.


      • #4
        In needs some manual customization.


        • #5
          Seems logical.

          At least, which files need to be customized? EspoCRM's structure is still very complicated for me.


          • #6
            look to
            and Contact.

            There are custom view for shipping address. You can do the same for your new contact field (metadata in custom folder)


            • #7
              It's working. Thank you.

              But there is another problem with it now:
              (It's B2C case)
              For example, when I create new Lead, it have "simple" Address.
              Next I'm converting this Lead to Contact (my "new" Contact now have two address fields - billingAddress and shippingAddress) and in result address information "stay" in "simple" Address fields.

              So now there are three different addresses in CRM: Address, billingAddress and shippingAddress. Kinda a lot of addresses. =)
              May be it will be logical to get rid of "simple" Address and replace it with billingAddress CRM-wide OOTB? (billingAddress is "basic" and shippingAddress is additional)


              • #8
                This worked perfectly for Me! Except I was doing it to Opportunity and a Different Address Label of ServiceAddress.
                Now I put the file in the following directory: C:\xampp\htdocs\espocrm\client\modules\crm\src\vie ws\opportunity\fields\service-address.js

                Will an upgrade/update break this? Should it be in the custom directory somewhere?


                • #9


                  • khopper
                    khopper commented
                    Editing a comment

                    I created the directories as you described client/custom/src/views/opportunity/fields/service-address.js and set in entityDefs the view "custom:views/opportunity/fields/service-address" as you described.

                    Upon rebuilding it prevented me from creating an opportunity completely the form would not even come up would stay stuck on loading....
                    I reverted the by removing src/views/opportunity/fields/service-address.js and changed entityDefs the view "crm:views/opportunity/fields/service-address" and it began working again without issue.

                  • tanya
                    tanya commented
                    Editing a comment
                    I hope json was valid, so seems you defined a view wrong. Is it possible to see the custom view definition?

                  • khopper
                    khopper commented
                    Editing a comment
                    The json file works perfectly pointing to "crm:views/opportunity/fields/service-address" its when I change it to view": "custom:views/opportunity/fields/service-address" it stops working.
                    I copied the working/vaild file "service-address.js" to "/client/custom/src/views/opportunity/fields/" from "/client/modules/crm/src/views/opportunity/fields/"

                • #10
                  Tanya, here are some screen shots of what happens for a visual.
                  Last edited by khopper; 02-02-2018, 06:25 PM.


                  • #11
                    Open browser console. Is there any error message?