Adding Custom JS and CSS to Contacts Create page

I'm a bit new to SugarCRM so I'm looking for some guidance in the right direction. I currently have a sandbox sugar cloud instance that I am attempting to load a custom module in.

I am attempting to add an "address autocomplete" feature to the Contacts record create view. To do this, I need to add some custom css and javascript to the create page that will call an autocomplete API based on user input into an address field.  

I attempted to extend the Record/Create controllers but the module I loaded into the module loader seems to have broken the contact create page. Any help on adding custom js and css to the module create page would be greatly appreciated.  

  • Contact Faye; They have a Module Loadable Package which will add Google Autocomplete to all modules with Addresses

    fayedigital.com/.../

  • Thanks for this recommendation. I will take a look. I am attempting to roll my own integration with a non-google autocomplete service but I'll see if they can point me in the right direction.  

  • Hi Dylan,

    would be helpful if you could share some more details on how you're loading your modules, sample of your code as well as the errors you're getting, dont forget to mention your sugar version.

    rafa

    SugarCRM | Principal Developer Advocate

  • I believe that the best approach is to inject the css into custom/themes/custom.less and create a custom field type where you can place the appropriate js controller.

    This way your CreateView remains intact.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi Dylan,

    In our Add-On AddressHelper we have used Algolia Places but Algolia will stop it in a few months.
    (Our next version is using LocationIQ and will be available as soon as the Doc is being updated).
    They use OpenStreetMap database and offer a free plan.

    You do not need to load their js lib as they provide an API, and we did as André suggested and put our js logic in a custom field.

    Cheers,
    Laurent