Module Builder – What's new in 5.1

bsoremsugar —  August 28, 2008 — 10 Comments

One of the best parts of using Sugar has to be customizing it. You don’t want to use a software package if it can’t meet your needs, and no two people or businesses have the same set of requirements. Sugar provides some really neat tools when it comes to customization, and in 5.1 they have been made even better.

There are a lot of really cool additions to the 5.1 developer tool set, and I’d thought I’d take a minute to quickly go over a couple of them.

Once you open up Module Builder in 5.1, you will notice the addition of two new templates, File and Sale. The File template is for document-based modules such as resumes, photos, or any other files you need to work with. Sale is based on the opportunities module and is designed to store information on sales and possible future sales.

After you have created a new module, you may also notice a few more new things. One that I would like to point out is under layouts, we have added Sugar Dashlet views. Starting in 5.1, your new custom modules will have Sugar Dashlets available straight out of Module Builder. You can edit the Sugar Dashlet layouts in the same manner as standard list and search views.

Finally, I’d like to touch on the area of integrations. In previous versions of Sugar, there wasn’t an easy way to integrate with existing web based systems from Studio or Module Builder. Certainly you can find many tutorials on how to add custom logic hooks to do this, but there hasn’t been a way to do integrations writing any code. In 5.1, this has changed with the addition of Link fields and iFrames with auto-generated URLs.
I’ll show how this is used with a fairly simple example, adding a Google map to the DetailView of a company. In this case my new “Partners” module which is based on the company template.

  1. Open up your custom module’s fields, and click “Add Field”.
  2. Select the IFrame field type.
  3. Fill in the following data:
    • FieldName: GoogleMap
    • Display Label: Google Map
    • Generate URL: check
    • Default Value (now this is where the magic happens):
      http://maps.google.com/maps?f=q&q={shipping_address_street}+
      {shipping_address_city}+
      {shipping_address_state}+
      {shipping_address_postalcode}+
      {shipping_address_country}
    • Max Size: 255
    • IFrame Height: 400
  4. Add the new field to your DetailView. Be sure to give the field a full row to itself for maximum readability. Note that adding an iFrame or a Link field that has a generated URL to an EditView will result in a read-only field that is un-editable.
  5. Deploy your package and create a new record in your new module, be sure to enter a real address into the shipping address fields.
  6. Save the record and view the Google map pointing to the business’ location.

The uses for generated URLs are almost endless, as you can embed links and iFrames to either internal or external systems without writing a single line of code. Feel free to post some ideas for other integrations.

10 responses to Module Builder – What's new in 5.1

  1. 

    Hello,
    I’m sorry, but when I try your code I haven’t the good reasult ( I have : “[shipping_address_street] [shipping_address_city] [shipping_address_state] [shipping_address_postalcode] [shipping_address_country]” in the google maps adresse field.
    Could you help me please.
    Best regards.
    Manu

  2. 

    Hello,
    I’m sorry, but when I try your code I haven’t the good reasult ( I have : “[shipping_address_street] [shipping_address_city] [shipping_address_state] [shipping_address_postalcode] [shipping_address_country]” in the google maps adresse field.
    Could you help me please.
    Best regards.
    Manu

  3. 

    Hi David

    Thanks for an interesting article!

    I had a try at adding googlemaps in an iframe as described above, and noticed that you must change the order of steps 3.4 and 3.5

    It may not be obvious to all.

    I would describe it like this:
    3. Fill in the following data:
    1. FieldName: GoogleMap
    2. Display Label: Google Map
    3. Generate URL: check
    4. Max Size: 255 (must be done before entering the default value below)
    5. Default Value (now this is where the magic happens):

    http://maps.google.com/maps?f=q&q={shipping_address_street}+

    {shipping_address_city}+
    {shipping_address_state}+
    {shipping_address_postalcode}+
    {shipping_address_country}
    6. IFrame Height: 400

  4. 

    Hi David

    Thanks for an interesting article!

    I had a try at adding googlemaps in an iframe as described above, and noticed that you must change the order of steps 3.4 and 3.5

    It may not be obvious to all.

    I would describe it like this:
    3. Fill in the following data:
    1. FieldName: GoogleMap
    2. Display Label: Google Map
    3. Generate URL: check
    4. Max Size: 255 (must be done before entering the default value below)
    5. Default Value (now this is where the magic happens):

    http://maps.google.com/maps?f=q&q={shipping_address_street}+

    {shipping_address_city}+
    {shipping_address_state}+
    {shipping_address_postalcode}+
    {shipping_address_country}
    6. IFrame Height: 400

  5. 

    Hi,

    I’ve tried to put this kind of field on accounts directly, but the link is always:

    http://maps.google.com/maps?f=q&q=+++++++&ie=UTF8&z=4

    Course, the map won’t show the data correctly. If i put the addresses manually, it works.

    Best regards

  6. 
    pedro teixeira March 30, 2009 at 3:04 pm

    Hi,

    I’ve tried to put this kind of field on accounts directly, but the link is always:

    http://maps.google.com/maps?f=q&q=+++++++&ie=UTF8&z=4

    Course, the map won’t show the data correctly. If i put the addresses manually, it works.

    Best regards

  7. 

    David, thanks for this useful post.

    My contribution:

    Add

    &output=embed

    at the end of the URL, and get a view without the google navigation elements.

    Cheers!

  8. 

    David, thanks for this useful post.

    My contribution:

    Add

    &output=embed

    at the end of the URL, and get a view without the google navigation elements.

    Cheers!

Trackbacks and Pingbacks:

  1. iFrames - September 25, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s