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.
  • Hi Dan,

    We've tried your approach and it all works well until we make any change from Studio for that layout and Save&Deploy.

    Can you please tell us if its a known issue that making changes via Studio to the layout reverts the changes made to the primary_address field?

    We also tried another approach :
    Create a custom field/view  called "fieldset_additional" based on the original field/view "fieldset" (which is used for the "primary_address" field in Contacts)
    ie

    COPY
    /clients/base/fields/fieldset/fieldset.js
    TO
    /custom/modules/Contacts/clients/base/fields/fieldset_additional/fieldset_additional.js

    We then set the custom "fieldset_additional" as the "type" for the "primary_address" field in the Record View.
    Even in this scenario, a Repair&Rebuild works perfectly but Alas!, if we make changes from Studio, the changes are still reverted and the "primary_address" field "type" also reverts back from "fieldset_additional" to "fieldset"

    I'm sure this isnt intended as Sugar does allow us to extend and create our own custom controllers for the fields.

    We've extended fields like "relate" in the past and they dont revert back when changes are made via Studio.

    There seems to be something weird/wrong about "fieldset" type and/or the "primary_address" field.

    Thanks
    Kedar.
  • Hello Kedar,

    Due to a known bug in Sugar 7.2.x, code level changes made to the 'record.php' file will be over-written by changes made in Studio.

    This bug has been addressed in 7.5.0.0, which will be released soon.  For more information, please present this to the SugarCRM Support team: http://support.sugarcrm.com/

    Regards,

    Dan Kallish
    Advanced Support Engineer
    SUGARCRM

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com
Reply Children
No Data