How can we add additional address fields in 7.2?

How can we show address 2 in the on-demand 7.2 version of Sugar?  We can't be the only ones out there who need this capability, are we missing something obvious or does sugar not allow people to have secondary, or third, addresses?
Parents
  • Hello,

    You can use these steps to create a 'Address 2' field and add it to the Address block in each module:

    1. Login as an Administrator and navigate to Admin > Studio.
    2. Select the module where you want to add the 'Address 2' field, then click Fields and select Add Field.
    3. Use the Field Type 'TextField' then enter the relevant information, so that it appears similar to this screenshot:
    4. Save the new field.
    5. Access your SugarCRM File System and navigate to the following location:
      ./custom/modules/<Module>/clients/base/views/record/
    6. - If this directory does not exist, you can easily create it by going to Admin > Studio > <Module> > Layouts > Record View, and clicking 'Save & Deploy.'
    7. Open the 'record.php' file in a text editor.
    8. Locate the following array:

      - The 'name' values may be slightly different based on the Module you're working in.
    9. At the end of the 'array( 0 =>)' add a new line, then enter the following code:
       |
      - You'll need to adjust the 'name' and 'placeholder' values to match the field you created.
    10. You'll need to update each of the subsequent arrays, so that their numeric value is one greater, so the original '1 => array()' should become '2 => array()' and so on until the address field arrays are numbered correctly.
    11. Save your changes to this file.
    12. Return to Sugar, then navigate to Admin > Repair and use Quick Repair and Rebuild.
    13. If you navigate to your module and click the Edit button, you should see that there is now a second line in the address field block:

    You'll need to use these steps for each Address Block in each module, but it does provide the ability to add additional fields.

    Regards,

    Dan Kallish
    Technical Support Engineer
    SUGARCRM

  • Excellent Dan, very easy to follow your instructions, I will simply comment that the path to the file seems to be different... my environment is SugarEnt-Full-7.2.0/custom/modules/Leads/clients/base/views/record  (base and views are reversed), and also that you should not forget to modify the array to "copy to alternate address", or it wont work!  Thanks again
  • This is all great, but what about the on-demand environment?  This cannot be done through Studio.
  • This reply was created from a merged topic originally titled  Add a new street field to the address group in Accounts/Contact module in Sugar 7.  Hi All,

    We need to add another street field to the address group field in both the Accounts and Contacts module for primary and alternate address.

    After creating a custom field for it we have tried to add it to the group by writing the code in custom/modules/Accounts/clients/base/views/record/record.php in the fieldset for the address fields. This works but the changes made here are overwritten if we make any further changes from Studio.

    We have also tried to use the Extension framework to add the new field to the address group but could not find the right thing to do.

    We have done this earlier in Sugar 6.5.* by creating a new field type for address but that is not applicable for Sugar 7 upgraded modules any more.

    Any pointers and directions on what is the correct way to implement this would be great.

    Thanks in advance.

    Kirti


Reply
  • This reply was created from a merged topic originally titled  Add a new street field to the address group in Accounts/Contact module in Sugar 7.  Hi All,

    We need to add another street field to the address group field in both the Accounts and Contacts module for primary and alternate address.

    After creating a custom field for it we have tried to add it to the group by writing the code in custom/modules/Accounts/clients/base/views/record/record.php in the fieldset for the address fields. This works but the changes made here are overwritten if we make any further changes from Studio.

    We have also tried to use the Extension framework to add the new field to the address group but could not find the right thing to do.

    We have done this earlier in Sugar 6.5.* by creating a new field type for address but that is not applicable for Sugar 7 upgraded modules any more.

    Any pointers and directions on what is the correct way to implement this would be great.

    Thanks in advance.

    Kirti


Children
No Data