Skip navigation
All Places > Developer > Blog
1 2 3 Previous Next

Developer

173 posts

In our recent release of SugarCRM Mobile 6.2, we made a change to the way our iOS app talks to the Sugar server.  

 

We made this change because Apple deprecated their UIWebView component (since iOS 8) in favor of their optimized WkWebView.  In addition to providing performance improvements, WKWebView also provides additional security features and a more responsive user experience.  But WKWebView also added enforcement of cross-origin resource sharing (CORS), so the mobile team needed to add a native proxy that runs local on your mobile device at localhost:8081. 

 

This proxy allows the SugarCRM Mobile app to work around these restrictions and can introduce connectivity issues for some SugarCRM Mobile users. Most users of SugarCRM Mobile are not affected, but if you are using SugarCRM Mobile with Enterprise Mobility Management (EMM) infrastructure (i.e. Airwatch with App Tunneling configuration, or VPN) then you may have already noticed connectivity issues after upgrading to 6.2. For example, some customers have reported an issue with the app hanging on the splash screen.

 

If you are affected, then you will need to adjust the whitelist in your EMM or Mobile Device Management (MDM) tool to allow traffic to localhost:8081. Please consult your EMM / MDM documentation for steps necessary to perform this configuration change.

 

Below is a diagram that shows the new proxy should work in an EMM infrastructure.

If you are an on-premise customer using our Mobile SDK, you have the option of enabling CORS support in Sugar by adjusting your .htaccess configuration to send the correct CORS headers (and removing the proxy). Sugar Enterprise customers with access to the SugarCRM Mobile SDK can build a custom app with adjusted the proxy settings for their own environment.

 

Please leave any questions or feedback below and we'd be happy to help!

Hi everyone! I’m Megan Sheehan, business analyst and trainer at Technology Advisors, and proud Sugar Scholar at sugarcon 2018.

 

Lauren Schaefer (@Lauren_Schaefer) gave the first developer-focused presentation this year, “Dissecting Professor M for Best Practices,” and it was great! Lauren did an awesome job engaging the audience with polls and interactive Q&A while sharing insights into how and why developers should engage with professor m.

 

The developer community is hopefully already familiar with the basics of Professor M, but Lauren explained how we can use the Professor M repo for examples of both customization and DevOps best practices. Even better, we can contribute our own code examples to the repo so that Sugar Engineering will test against them as part of their testing process – meaning your customizations will be even more ‘upgrade safe’ than ever!

 

Check out Lauren’s slides for all of the details.

We had a fabulous time meeting so many of you in Las Vegas for SugarCon 2018 last week!  We learned, we laughed, and we danced.  It doesn't get much better than that!

 

We introduced a new program at this year's SugarCon:  Sugar Scholars.  The Sugar Scholars program is a competitive program that partners and customers applied to.  Sugar Scholars were selected based on their advocacy of Sugar all year long.  The Sugar Scholars received a scholarship to attend SugarCon and helped us run the SugarCon Developer Track.  You may have seen them greeting you at the Developer Lunches, keeping our speakers on time, and giving lightning talks (how fun were those???).

 

One way they are helping behind the scenes is blogging about each of the breakout sessions in the Developer Track.  Over the next few weeks, you'll see their posts in this blog.  Be sure to check out their posts as they will be including a high level overview of each session as well as a link to the speaker's slide deck.

 

Let me introduce you to our fabulous group of Sugar Scholars.  

From left to right, they are...

  • Niegel Leoncio, CRM Manager, Bishop Wisecarver Corp
  • Kristjan Geir Mathiesen, Systems Analyst, Origo hf
  • Justin Kuehlthau, Director, SugarCRM Practice, Technology Advisors, Inc.
  • Megan Sheehan, Business Analyst & Trainer, Technology Advisors, Inc.
  • Jeff Bickart, Director of Operations, Faye Business Systems Group 
  • Me--not actually a Sugar Scholar, but they let me jump in their picture anyway. :-)

 

Whether you were able to join us in Las Vegas or not, you can still join in on the fun on social media.  Be sure to check out the SugarCon Photo Album on the SugarCRM Facebook Page.  You can also discover some notable moments on the SugarCRM Developers Twitter page and the SugarCRM Twitter page.

 

If you have feedback from this year's conference, we'd love to hear it!  Let us know in the comments below how we can improve for next year.

 

We're already looking forward to SugarCon 2019!

Hey there, developers!  We've officially released Fall '18!  This release is just for Sugar Cloud (formerly known as Sugar On-Demand).  Don't worry on-prem users--you'll get these changes in our upcoming 9.0 release! 

 

This release has a ton of great features including new quotes configuration options for administrators, new data visualizations, and enhancements to Advanced Workflow that allow you to automatically send email alerts to a wider audience and to a more selective set of recipients.

 

Our Co-Founder & CMO, Clint Oram, discusses the highlights of this release from an end-user's perspective in the video below: 

 

 

I recently hosted a webinar where I gave an overview of the big things developers need to know about this release:

 

The slides from the webinar are available here.

 

If you're looking for the high-level overview, I've got you covered!

  • We've upgraded several libraries including Handlebars, Underscore, jQuery, jQuery Migrate, and jQuery UI.  You can get the details in my blog post You'll never guess which libraries are changing in the upcoming Sugar release.
  • Administrators now have a web interface where they can configure the Quotes module.  This means less coding for you!  Ensure any fields that your code customizations rely on are visible or included in a SugarLogic formula for a visible, calculated field. 
  • If user subscription limits are enforced on a Sugar subscription key, SAML and LDAP JIT user provisioning will not allow a customer to accidentally exceed the number of allowed active users.
  • Our REST API version increased to 11.3.
  • We have improved our support for OAuth 2.0 by adding support for bearer tokens.  Get all of the details with examples in my blog post The Sugar REST API adds support for OAuth 2.0 bearer tokens in Fall '18. 

 

This blog post promised to have just about everything you need to know about the Fall '18 release.  Below are some resources that have the rest of the details.

 

We hope you’re as excited about this release as we are!

You’ve been asking for it.  We’ve been listening.

 

We're improving our support of OAuth 2.0 standards by adding support for RFC 6750 bearer tokens in the Sugar Fall ‘18 release.  

 

So what's changing?  You’ll still authenticate to get the access token the same way.  For example, you might authenticate with a call similar to the following:

 

curl -X POST \
 https://mysugarinstance/rest/v11_3/oauth2/token \
 -d '{
  "grant_type":"password",
  "client_id":"sugar",
  "client_secret":"",
  "username":"admin",
  "password":"asdf",
  "platform":"base"
}'

 

And get something like the following in the response body:

{
   "access_token": "37cfa546-055b-43c9-8273-466fbf4b3235",
   "expires_in": 3600,
   "token_type": "bearer",
   "scope": null,
   "refresh_token": "671d8117-c8b7-4dee-92d6-4f309d717090",
   "refresh_expires_in": 1209600,
   "download_token": "eeb702a9-ec35-4a92-9619-d914172b5eac"
}

 

In versions prior to the Sugar Fall ‘18 release, you would include the access_token you received in response to the authentication call as an OAuth-Token in the header of subsequent requests.  For example, if you wanted to get a list of the Accounts, you would make a call like the following:

 

curl -X GET \
 https://mysugarinstance/rest/v11_3/Accounts \
 -H 'OAuth-Token: 37cfa546-055b-43c9-8273-466fbf4b3235'

 

Beginning in Sugar Fall ‘18, you can now follow OAuth 2.0 standards and pass the access_token as a Bearer Token.  Following the same example as above where we retrieved a list of the Accounts, you can now make a call like the following:

 

curl -X GET \
 https://mysugarinstance/rest/v11_3/Accounts \
 -H 'Authorization: Bearer 37cfa546-055b-43c9-8273-466fbf4b3235'

 

The difference is small.  You’re still passing an access token in the header of each request--you’re just changing the format of that header.  

 

So why are we making this change?  If you have integrated with other OAuth 2.0 resources, you’ll be able to reuse more of that code and/or behavior.  This change also enhances the interoperability of our APIs with standard tools and libraries. Plus, following industry standards is always a good thing.

We're just one month away from SugarCon, and we can't wait to meet you there in Las Vegas!  If you haven't registered already, you can still do so at sugarcon.com.  

 

The SugarCon agenda is packed full of keynotes, breakout sessions, training, certification exams, networking opportunities, food, and, of course, drinks.  Below is the agenda we've been preparing just for developers.  Check out the full SugarCon agenda for even more.

 

Wednesday, October 10

7:30 AM - 9:00 AMBreakfast (for all conference attendees)
9:00 AM - 12:00 PMOpening Remarks & Morning Keynotes (for all conference attendees)
12:00 PM - 1:30 PMDeveloper Lunch
1:30 PM - 2:30 PMDissecting Professor M for Best Practices
2:30 PM - 3:30 PMPerformance is a Feature
3:30 PM - 4:30 PMPreparing for Sugar Upgrades
4:30 PM - 5:30 PMAsk Me Anything Networking (for all conference attendees)
5:30 PM - 7:00 PMDevelopers Happy Hour & Lightning Talks
7:00 PMParty! (for all conference attendees)

 

Thursday, October 11

7:30 AM - 9:00 AMBreakfast (for all conference attendees)
9:00 AM - 12:00 PMOpening Remarks & Morning Keynotes (for all conference attendees)
12:00 PM - 1:30 PMDeveloper Lunch
1:30 PM - 2:30 PMDeep Dive into Data Privacy Architecture
2:30 PM - 3:30 PMIntegration Best Practices
3:30 PM - 4:30 PMSugar, DevOps, and IBM
4:30 PM - 6:30 PMDeveloper Happy Hour & Ask the Experts
Certification Exams

 

P.S.  You can still vote for the topics you'd like to discuss at our developer lunches here!

The new dates for Fall '18 developer webinars are September 18 and 19. We apologize for any inconvenience!

Hello Sugar Developers!

 

We want to make sure your customizations and integrations are ready for the Sugar Fall '18 release, so we’re hosting two webinars just for you!

 

What we will be covering:
We’ll discuss the big changes that are likely to impact you including the following:


Webinar Information:
We are holding two sessions to accommodate various geographical locations. Please choose ONE of the following times below.


Tuesday, Sept 18th 5:00 - 6:00 PM PT
OR
Wednesday, September 19th 8:00 - 9:00 AM PT
(Choose one)

 

Register Here

 

We will be posting the webinar recordings to the Sugar Community for those who are unable to attend the live sessions.

Introduction

Does your Sugar implementation extensively leverage Team security to apply data visibility rules? Do you have modules containing a few hundred thousand records?

 

If the answer is yes to at least one of these two questions and you are on Sugar version 7.11 or above, there is a great news for you! We have been developing a performance improvement for the above scenarios called Teams Denormalisation that can be enabled on your system.

 

Team security in a nutshell

Team security prevents a user from seeing records not associated with one or more of his/her teams. Administrator type users are exempt from visibility rules.

 

For example, Image 1 represents a Team security scenario. In this example, Jane is part of the Yoga Team, so she can view both the Yoga budget and the Yoga schedule records. Since she is not a member of the Accounting Team, she cannot view the Company budget record.

 

 

Image 1: End-user representation of a Teams visibility scenario

 

Team security technical implementation

To allow granular control over the single record visibility, a record can have multiple Teams associated with it. The unique combination of Teams is referred to as a "Team Set".

 

For example, Image 2 represents a Team security scenario that includes Team Sets. In this example, the Project1 test plan record is related to the Team Set Project1 and QA Automation (including the Project1 and QA Automation Teams). The record can be seen by the three users David, Esther and Ruslan, as they are all either members of Project1 and/or QA Automation Teams. The Project1 backlog record is related to the Project1 Team Set (including only the Project1 Team). The record is visible to David and Esther, but it is not visible to Ruslan.

 

 

Image 2: Back-end representation of a Teams visibility scenario, with Team Sets

 

More details of the Teams inner workings can be found within the Developer Guide.

 

High level description

Teams denormalisation is designed to simplify and therefore improve performance of runtime SQL system queries that are executed to display only records visible to the current user.

 

Detailed description

Teams denormalisation denormalises (and therefore duplicates) the information about which users are part of which Team Set. With this approach, the system can immediately determine if the current user accessing the system has an overlap on the Team Set for the module's records.

 

As denormalisation requires data duplication, every time a change on a Team Set happens, it is reflected either on the SQL table team_sets_users_1 or on team_set_users_2. Basically, the current SQL denormalisation table tracks which user ids are members of each Team Set.

 

Teams denormalisation has a few components. The main components that can be useful for debugging and supporting this functionality are the following:

  1. A scheduler job to complete background actions.
  2. Two additional SQL tables (team_sets_users_1 and team_sets_users_2). Only one of the two tables is considered active by the system at any one time.
  3. A configuration string on the config SQL table to determine: if the feature is enabled, what SQL table is currently considered active, and if the system knows if the current denormalised table is up to date or not.
  4. Two Sugar CLI commands to check the status of the system or to help rebuild the data.

 

Once the functionality is enabled, the background scheduler job will populate with data the SQL table that will be considered active. Upon completion, it will set the database configuration options accordingly, to let the system know that it is ready to use the denormalisation.

 

While waiting for the background scheduler job to finish, the system will automatically keep using the standard subquery based Teams lookup (not causing interruption of service).

 

A similar approach happens during rebuilds. The SQL table currently active is queried until the secondary SQL table is fully populated, and ready to be switched over.

 

When Teams denormalisation should be enabled

The Teams denormalisation feature is highly recommended for systems that are leveraging out-of-the-box Team security for data visibility purposes and have a decent size team set quantity.  As a base guideline, if there are more than 100,000 unique Team Sets combinations, the functionality should be considered. The functionality will be most beneficial for modules that have the largest number of records (over a few hundred thousand).

 

A possible drawback of Teams denormalisation is that the visibility of records can be applied with time delay, if the system is configured to propagate the Teams structure changes in the background (ie: not synchronously) or when a full SQL table rebuild is required.

 

It is not recommend to enable Teams denormalisation for customers with customised visibility rules that therefore do not use the standard product functionality as the system will most likely not be able to interpret the changes applied.

 

It is important to note that direct interactions with the database via SQL can corrupt visibility rules. For example, when a database restore is needed on an instance with Teams denormalisation enabled, you should forcefully initiate a full rebuild of the Teams denormalisation data after the database restore is complete.

 

Enabling Teams denormalisation

Complete the following steps to enable Teams denormalisation:

  1. Enable the Teams denormalisation scheduler job (Rebuild Denormalized Team Security Data) that is disabled by default
    1. Tune the interval of execution based on need or leave to the default 15 minutes
  2. Set the relevant settings in config_override.php 
  3. Wait for the Teams denormalisation scheduler to run and to complete the initial denormalisation. Alternatively, if available/possible, run the Sugar CLI command:
    ./bin/sugarcrm team-security:rebuild

 

Notes 

If the denormalisation is enabled, disabled and finally re-enabled through the config_override.php options and actions related to Teams have been completed through the framework while the denormalisation was disabled, the system will not enable the functionality immediately. The system only re-enables the functionality once the denormalised SQL table is brought again up to date. The denormalised SQL table can be brought up to date either by the next Teams denormalisation scheduler run, or by manually executing the repair Sugar CLI command where applicable.

 

Configuration settings

The use_denorm and inline_update settings can be applied to config_override.php to enable and configure Teams denormalisation. Detailed explanation of the configuration settings can be found below.

 

use_denorm

$sugar_config['perfProfile']['TeamSecurity']['default']['use_denorm'] = true;

From the Developer Guide:

This setting is used to enable or disable Team Security denormalization feature. Team Security denormalization can significantly improve SQL query performance when there are a large number of Teams in a Sugar instance. The cost is that this feature relies on a separate Team security denormalization table that needs to be updated as records change to ensure Sugar's Team security visibility rules are applied properly.

inline_update

$sugar_config['perfProfile']['TeamSecurity']['inline_update'] = true;

From the Developer Guide:

When denormalization is in use (perfProfile.TeamSecurity.default.use_denorm config set to true), this setting will allow the denormalization table to be updated in real time as records are updated in the system. If this setting is disabled, the denormalization table must be scheduled by the Sugar administrator via Schedulers > Rebuild Denormalized Team Security Data.

 

More details about inline_update

When Teams denormalisation is enabled and inline_update is set to "true", every action that affects Teams structures is completed synchronously.

 

If the option inline_update is set to to "false", the system will still synchronously add new Team Sets combinations (created at the module's record level). It will not perform synchronously actions that are completed on the admin area by an Administrator user such as:

  • adding users to a team (either directly or through reports to changes)
  • removing users from a team (either directly or through reports to changes)
  • deleting users (and therefore removing the user from a team)

The above actions can be expensive as the system needs to modify many entries on the denormalisation table currently in use. When the option is set to false, the action will be completed only when the scheduler executes its next run for the Teams denormalisation job. At that point the records will become visible/invisible according to the changes completed on the admin area.

 

The recommended approach is to start by setting the flag to "true", to make sure that all the changes are applied real-time. The save time for the Administrator(s) might increase slightly when performing changes that affect the Teams structure.

 

If this approach does not work for the specific scenario, it is possible to change the inline_update setting to "false" and be aware of the time delay required for the new visibility changes to be applied to the system.

 

Logger

For logging purposes, there is a dedicated logger channel provided for the Teams denormalisation functionality.

The denormalisation logger channel can be configured to "info" on config_override.php with the following configuration setting:

$sugar_config['logger']['channels']['denorm']['level'] = 'info';

 

All the available log levels are documented within the Sugar Developer guide.

 

Sugar CLI commands

Sugar has two Sugar CLI commands that are relevant to Teams denormalisation:

  • Status - Displays status information of the denormalised data
    • ./bin/sugarcrm team-security:status
  • Rebuild - Rebuilds the Teams denormalisation data when needed
    • ./bin/sugarcrm team-security:rebuild

 

Count unique Team Sets

It is possible to know how many unique Team Sets combinations exist within the system, by running the following SQL query:

 

SELECT
  COUNT(id)
FROM
  team_sets
WHERE
  deleted = '0';

 

Database configuration

The current database configuration settings for the Teams denormalisation can be read from the database with the following SQL query:

 

SELECT
    *
FROM
    config
WHERE
    category = 'team_security'

 

Sample SQL output showing the database settings of Teams denormalisation:

 

category: team_security
   name: denormalization_state
  value: {"rebuild_running":false,"active_table":"team_sets_users_1","up_to_date":true}
platform:

 

The information retrieved by the SQL query is also used by the system, and it can be easily displayed by the status Sugar CLI command wherever applicable.

 

Force repair

In cases where the denormalisation SQL table is not current (eg: data has been manually manipulated or data is of sync due to a database restore etc.), it is possible to enforce the re-build by running the Sugar CLI command to update the Teams denormalised data, by providing the additional parameter --ignore-up-to-date as shown below:

 

./bin/sugarcrm team-security:rebuild --ignore-up-to-date

 

The Sugar CLI command will truncate the content of the secondary table and complete a full alignment of the data. Then it will swap the SQL table the functionality is leveraging by updating the database configuration settings. This process removes the need for a downtime period during rebuild as the system is either attempting to point to an up-to-date SQL table or fall back to the standard functionality.

 

When the rebuild command is run without the parameter --ignore-up-to-date, the system is unable to understand if there are discrepancies introduced via SQL. The command will only understand discrepancies due to changes in Teams structure/user structure that were generated through the framework.

Hey there, developers!

 

We are hosting lunchtime table topics just for developers on both days of SugarCon.  After you pick up your lunch, you'll be able to browse tables that are labeled with various topics and select one that interests you.  We'll have a facilitator at each table to get the conversation going.  Everyone, regardless of experience level, is invited!  You're welcome to share your knowledge, ask questions, or just sit and listen.  This is your chance to do a little networking with other developers and learn something that may not be covered in the breakout sessions.

 

We need your help in deciding what the table topics will be!  I've added comments to this blog post with some ideas we have.  If we missed a topic you're interested in discussing, add a comment below with your suggestion.

 

Most importantly, we want you to vote!  Click the Like button on topics below to vote for your favorites.

 

We can't wait to see you at SugarCon on October 10 and 11!  If you haven't registered yet, you can register at sugarcon.com

 

P.S.  Don't forget to submit your proposal to give a 5 minute lightning talk at SugarCon by Tuesday, August 21, 2018!

Or maybe you will.  Click-bait headlines are the worst.  Don't worry, I won't make you click through an ad-covered slideshow to find all of the library changes.

 

Anyway, we have a few library updates coming in our upcoming Fall '18 release, and we wanted to give you as much time as possible to begin preparing for the changes.  Without further ado, below is information on upgrades to Handlebars, Underscore, jQuery, jQuery Migrate, and jQuery UI.

 

Handlebars

The Handlebars library is a JavaScript library that lets Sugar create semantic templates.  Handlebars help render content for layouts, views, and fields for Sidecar.  You can learn more about Sugar's use of Handlebars in the Sugar Developer Guide.

 

Handlebars v4 included significant changes to depthed paths that would likely break many customizations and integrations (see the Handlebars 4.0.0 Release Notes for more details).  However, v4 also included improvements we wanted to get to you.  Below is information on our solution.

What is changing?

In order to get you the improvements without breaking your customizations and integrations, we have created a forked version of Handlebars v1.3.0 with a unique version number ("1.3.1-sugarcrm-temporary") that we intend to include in the Fall '18 release. 

What documentation should I reference?

What's coming in the future?

The forked version of Handlebars is intended to be a temporary solution that we intend to discontinue using and/or remove in a future version of Sugar.  Given the breaking changes to depthed paths in v4, we are exploring alternatives to reduce disruption to existing customizations and allow developers as much time as possible to adapt. Watch this blog for updates as we plan our path forward.

 

Underscore

Underscore is a Javscript library that Sugar uses to improve code readability and performance.  You can learn more about how you can use Underscore in your apps and customizations in Matt's blog post Using Underscore.js to improve Sugar 7 performance.

 

Underscore 1.9.0 includes big performance improvements that we want you to benefit from, so we will be upgrading it.

What was upgraded?

  • Underscore will be upgraded from 1.8.3 to 1.9.1.
  • In Ventana, Underscore was upgraded from 1.8.3 to 1.9.1.

What documentation should I reference?

What else should you know?

No functionality will be deprecated as part of this upgrade, so we expect the impact to be quite low.

 

jQuery, jQuery Migrate, and jQuery UI

We are upgrading jQuery, jQuery Migrate, and jQuery UI in the Fall '18 release.  jQuery is a Javascript library we use for tasks like traversing and manipulating the DOM and handling events.  jQuery Migrate is a Javascript library we use to help us migrate to newer versions of jQuery without our code breaking due to APIs being removed in the newer versions.  jQuery UI is a Javascript library we leverage for various interface interactions, effects, widgets, and themes.

 

Below are (hopefully) all of the answers to your questions related to the upgrades of these libraries.

What will be upgraded?

  • jQuery will be upgraded from 1.11.3 to 1.12.4 for both Sidecar and BWC. 
  • jQuery Migrate will be upgraded from 1.2.1 to 1.4.1 for both Sidecar and BWC.
  • jQuery UI will be upgraded from 1.11.4 to 1.12.1 for both Sidecar and BWC.
  • In Ventana, jQuery was upgraded from 1.11.3 to 1.12.4 and jQuery Migrate was upgraded from 1.2.1 to 1.4.1.

What will be removed or renamed?

  • The new versions of these libraries remove and deprecate various functions.  See the Changelogs and Release Notes in the Documentation section below for more details.  Two changes we think may affect many of you:

    • jQuery UI's .zIndex() function was removed.  You can consider using the .css() function instead.  For example, if you used .zIndex() to get the z-index of an element, you could use .css('zIndex')instead.  In cases where you set the z-index of an element by doing something like .zIndex(1), you could use .css('zIndex', 1)  instead.  Be sure to test your changes to ensure everything is behaving as you expect.  For other recommendations on how you could update existing code that uses the .zIndex() function, see the jQuery UI 1.12 Upgrade Guide
    • jQuery UI's CSS class name ui-icon-carat was renamed to ui-icon-caret.  We recommend searching and replacing all instances of ui-icon-carat with ui-icon-caret.
  • jQuery version 1.7.1 will be removed; portal/lib/jquery-ui/js/jquery-1.7.1.min.js will be removed.
  • An unused copy of jQuery 1.6.4 that was available at include/javascript/jquery.js will be removed.
  • The jQuery UI CSS component files will move to a components directory and be renamed to no longer begin with jquery.ui.  For example, the jQuery UI dialog was previously include/javascript/jquery/themes/base/jquery.ui.dialog.css and will be moved and renamed to include/javascript/jquery/themes/base/components/dialog.css.

What will not change?

For backwards compatibility, we will retain the file include/javascript/jquery/themes/base/jquery.ui.all.css and it will continue to work as before. Image files in include/javascript/jquery/themes/base/images will also be retained.

What documentation should I reference?

What's coming in the future?

Upgrading jQuery and jQuery Migrate to version 3.x is on the roadmap for an upcoming release, so we recommend beginning to look at how you will update your customizations and integrations to use a modern version of these libraries.

What else should you know?

A minified version of jquery.ui.all.css will be available at include/javascript/jquery/themes/base/jquery.ui.all.css.

 

If you are using jQuery plugins (see The jQuery Plugin Registry or The npm Package Search), you may need to upgrade those to newer versions that are compatible with jQuery 1.12.4 and jQuery UI 1.12.1.

We're doing something new at SugarCon this year, and we want you to be a part of it!  During happy hour on the first night of the conference, we're hosting a series of lightning talks for our developers. 

 

These lightning talks are going to be five minutes long, consisting of 20 slides that automatically advance every 15 seconds.  You can learn more about this exciting talk format in the video below!

 

Whether you're brand new to public speaking or a seasoned speaker, this is a great way to share your story, add to your speaker's resume, and build your personal brand.  Attendees will be sipping cocktails and ready to cheer you on! 

 

Our call for proposals is open now until Tuesday, August 21, 2018.  Submit your ideas here

 

We look forward to hearing your story!

This blog by SugarCRM Technical Account Manager and Solution Architect Angel Magana is reposted with his permission. See Angel's Blog: SugarCRM: Related Data Interactions for the original post from Angel's blog. In this post, Angel explains some best practices for working with related records in PHP that can help improve performance of your customization.

Fetching related records

 

Often times a customization we are working on requires us to interact with related data, usually records that have a parent-child relationship with one another. For example, a customization might require us to determine if a given Account record has 1 or more related Contacts. Or for that matter, we may need the collection of ID values that represent all the Calls linked to a Contact.

 

In either example, the path most often followed could be described with the following pseudo-code:

 

1. Instantiate the parent SugarBean object (e.g. Account/Contact record object)
2. Load the corresponding relationship to access the related data objects
3. Retrieve the related SugarBean objects representing the related objects

 

See below for a PHP snippet illustrating the above:

 

<?php 

//Some other code

//Instantiate parent record SugarBean object
$ParentBean = BeanFactory::retrieveBean('Accounts', 'some_account_id_value');

//Load the pertinent relationship using Link field name
$ParentBean->load_relationship('contacts');

//Retrieve related Contact(s) SugarBean object(s)
$RelatedContacts = $ParentBean->contacts->getBeans();

//The rest of our code


Line 12 in the above example would effectively create an array of SugarBean objects representing the linked Contacts. From that point forward, determining whether or not the Account has any linked Contacts becomes a simple matter of checking the size of the array. 

 

For the linked Calls example, the code would be very similar, except we would load the 'calls' relationship and the ID values we want would be in the SugarBean object array that results from executing the getBeans() method.

 

Do you need full Beans or just the IDs?

 

Now, all of the above would function just fine, but let us consider a few things about this approach.

 

First, upon executing the getBeans() method, we are asking Sugar to retrieve the complete SugarBean object for all the related records of a given type. However, for both examples, simply retrieving the ID value would have sufficed.

 

That is, for our purposes, a list of ID values in the $RelatedContacts array is just as good as an array of all the SugarBean objects. That array would still allow us to properly answer the question of whether there are or are not any linked contacts, solely based on the number of ID value entries the array contains.

 

In the case of the second example, we specifically only need the ID values of the related Calls, but getBeans() gives us everything pertaining to each of those calls. This tells us there is a lot of overhead we can trim.

 

From a performance standpoint, anytime we can optimize our code to retrieve only what we need, we help minimize wait times a user experiences. 

 

How do we then change our code to only give us the ID values?

 

It is actually a quite simple.

 

<?php 

//Some other code

//Instantiate parent record SugarBean object
$ParentBean = BeanFactory::retrieveBean('Accounts', 'some_account_id_value');

//Load the pertinent relationship using Link field name
$ParentBean->load_relationship('contacts');

//Retrieve related Contact(s) IDs ONLY.
$RelatedContacts = $ParentBean->contacts->get();

//The rest of our code

 

Examining the Link2 class in Sugar reveals a get() method which specifically only returns ID values of related data. Using get() in place of getBeans() would allow us to achieve the goal described in our examples and also reduce the performance overhead.

 

Side note: A similar method exists in the TeamSet class, named getTeamIds(), to retrieve the ID values of Teams that compose a TeamSet, without needing to retrieve all of the Team SugarBean objects. Also be aware that get() will return all records, irrespective of team assignments on the related records. 

Hey there, developers!  We've officially released Summer '18 !  This is our fourth quarterly release for Sugar Cloud (formerly known as Sugar On-Demand).  Can you believe we now have a full year of quarterly releases?  

 

This release has a ton of great features including an updated login page, built-in support for double opt-in (think GDPR and data privacy!), emoji support , over 100 new built-in reports, and big improvements to advanced workflow.

 

Our Co-Founder & CMO, Clint Oram, discusses the highlights of this release from an end-user's perspective in the video below: 

 

 

Matt Marum and I recently hosted a webinar where we gave an overview of the big things developers need to know about this release: 

 

The slides from the webinar are available here.

 

If you're looking for the high-level overview, I've got you covered!

  • We have updated the Login page to display new content, so you'll want to make sure any customizations you made to the Login page still work.
  • Sugar now supports emoji!  You can get the details in Matt's blog post  
  • The GDPR and data privacy are hot topics, and that's why we have added to our existing data privacy features to support double opt-in.
  • We created a new ReportSchedules module that utilizes Sidecar.  If you have customized the old BWC report scheduling view, you'll need to reimplement those customizations for the new ReportSchedules module.
  • You can now export and import all business rules and email templates used in a process definition.  You no longer have to worry about manually reconfiguring pieces of your process definition when moving between environments.
  • We will be posting this release in the Developer Builds community so you can do your development locally.

 

This blog post promised to have just about everything you need to know about the Summer '18 release.  Below are some resources that have the rest of the details.

 

We hope you’re as excited about this release as we are!

Hello Sugar Developers!

 

We want to make sure your customizations and integrations are ready for the upcoming Sugar Summer ‘18 release, so we’re hosting two webinars just for you! The Summer '18 release is just a couple short weeks away.

 

What we will be covering:

We’ll discuss the big changes that are likely to impact you including the following:

  • Changes to Login screen and authentication classes
  • Emoji support
  • Built-in support for Double Opt-In (DOI)
  • Improvements to Reports and Advanced Workflow
  • SugarCon Update

 

Webinar Information:

We are holding 2 sessions to accommodate various geographical locations. Please choose ONE of the following times below.


Monday, July 2nd, 5:00 - 6:00 PM PT 
OR 
Tuesday, July 3rd 8:00 - 9:00 AM PT 
(Choose one)

 

Register Here

 

We will be posting the webinar recordings to Developer community for those who are unable to attend the live sessions.

 

P.S. Did you know you can apply for free passes to SugarCon by speaking at the conference or becoming a Sugar Scholar? Get the details on Two fabulous ways to earn a FREE pass to SugarCon 2018.

We have hit a tipping point in world wide Emoji usage. We really must work like we live, because the perfect two character combination of pizza and beer and others like it are starting to appear in business emails and other business communications. In particular, marketers have started to use emojis in subject lines of emails as a way to catch people's attention.

 

As Rich Green put it:

It's nearing the end of the second decade of the third millennium.

If people want to use poop emoji's in business, so be it.

 

Many Sugar customers have started running into an issue with emojis when using MySQL databases or the Sugar cloud. What could be so challenging about a poop emoji, you may ask? For that you may need a quick lesson on Unicode.

 

Character encoding and the beginnings of Unicode

Many of you are programmers, so you likely know that computers run entirely on (binary) numbers. As you type away on your keyboard, the stream of characters that gets stored in memory is a sequence of numbers based on the character encoding in use. "A" could be stored as 65, while "a" could be stored as 97, and so on. Programmers are obsessed with efficiency, so they would create many different character encodings for different alphabets or character sets to only use as little space as possible.

 

This became a real challenge as we started to share documents between systems via e-mail or the world wide web. Identifying and using the right character encoding became very important and also very difficult. If you didn't know the character encoding then you had to guess and if you guessed wrong then the text would not be displayed properly at all.

 

Encoding gone wrong. By Wikimedia Foundation (Wikimedia Foundation) [<a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0</a> or <a href="http://www.gnu.org/copyleft/fdl.html">GFDL</a>], <a href="https://commons.wikimedia.org/wiki/File:Mojibakevector.png">via Wikimedia Commons</a>

 

Fortunately, a group of companies, organizations, and individuals decided to come together to form the Unicode consortium. The Unicode consortium's primary mission has been to standardize character encoding into the Unicode standard that is widely used today. The most common Unicode character encoding is UTF-8 which is a variable length character encoding that can store any Unicode code point (which includes a growing number of emojis) into a number that is 1 to 4 bytes long.

 

MySQL's utf8 and utf8mb4 encodings

Programmers are obsessed with efficiency. Many programmers will not use 4 bytes if they think 3 bytes will do. When MySQL first implemented UTF-8 years ago, they decided that supporting the Basic Multilingual Plane (BMP) was good enough since it contained all the characters and most symbols used in modern languages. These characters require no more than 3 bytes. Adding support for the Supplementary Multilingual Plane (SMP) which includes emojis would mean that some characters would need to be stored in 4 bytes, which was just one byte too many for somebody.

 

Whatever the reason, MySQL's first implementation of UTF-8 that they called utf8 did not fully support UTF-8. When they fully implemented UTF-8 years later, they called it utf8mb4. This has been a source of confusion for many years since MySQL's utf8 character set seems to work fine until you run into certain special characters like emojis. Trying to store an emoji in MySQL's utf8 results in failure and the loss of data.

 

Sugar Summer '18 migrates from utf8 to utf8mb4

Sugar Summer '18 will use utf8mb4 for MySQL. This will allow users to import and display records and emails that contain emoji and other characters in the SMP. This feature will also be rolled into a future on-premise release.

 

The Sugar Summer '18 release will be available for Sugar cloud customers in a few short weeks.

 

Emojis in Sugar!

 

This character set and collation will be set automatically for new instances of Sugar and updated during the upgrade of existing instances of Sugar.  

 

If you have changed the default DB collation and you are in the Sugar cloud or on-premise using a MySQL database, then you should ensure that your collation is utf8mb4 compatible prior to upgrade. The collation can be set by the admin in Admin > Locale > Collation or by modifying config_override.php. If your collation is utf8mb4 compatible, the upgrade will automatically migrate the collation to utf8mb4. For example, if you have set your collation to be utf8_swedish_ci, the upgrade will migrate the collation to utf8mb4_swedish_ci. If no collation is set, Sugar will use the default utf8mb4_general_ci.

 

Database tables with very large row sizes (for example, custom tables with a large number of custom fields) may be unable to be automatically upgraded. The upgrader will notify you if a table would exceed the single-row size supported by MySQL (65,535 bytes) upon conversion to utf8mb4. In order to reduce the row size, we recommend the following:

  • Remove any/all fields that are not being used.
  • Reduce the lengths for char/varchar fields (e.g. size of longest existing value plus some padding).
  • Replace large varchar fields with text fields. Text fields are roughly 10 bytes, so significant size reduction exists when text fields can replace large varchar fields (e.g. VARCHAR(255).