Skip navigation
All Places > Developer > Blog > 2015 > November
2015
UPDATE December 28, 2015

 

During Sugar 7.7 upgrade, the upgrader will identify existing create-actions view/layout customizations and automatically migrate them to create view/layout.  This is a best effort migration that follows the two steps listed near bottom of this blog post.

 

If a custom create view/layout already exists, then create-actions changes will not be automatically migrated.

 

This will mitigate impact of this change for existing Sugar customers.

 

If you have been participating in the Sugar 7.7 Beta then you may have noticed that SugarCRM Engineering has refactored how CreateViews work in the Sugar application.

 

This post explains the motivations for the change and what Sugar Developers need to know and the actions they need to take to migrate their customizations in future Sugar 7.x releases.

 

Differences between Create and CreateActions

 

Historically, there has been some confusion in the Sugar Developer community (see here and here) around the existence of two different Create dialog layouts in the Sugar application.

 

CreateActionsLayout

 

The CreateActionsLayout includes the CreateActionsView.  This view included additional action metadata that gave the user additional options for saving a new record.  This particular layout was used for the majority of usage flows that created new records in Sugar.  Sugar Developers were taught to customize this view in order to change the behavior of the Create dialog but in reality this was never sufficient to customize the behavior of all possible Create flows.

 



 

CreateLayout

 

The CreateLayout includes the CreateView.  This view did not provide these additional actions.  It was used in certain flows such as when a user chooses to Quick Create a record at the top right corner of the page.  But it was not used nearly as often so a lot of Developers did not customize it or even know about it in some cases.

 



 

Relationship between Views

 

While CreateActionsView extends from the CreateView, they were used on separate layouts.  So while it was possible to customize the base CreateView and have those customizations appear in all possible Create dialogs in the application - a module level customization of the CreateView did not have a similar effect.  This is because the Module's CreateActionsView ultimately extended from the base CreateView and not the module's CreateView.  So Sugar Developers were stuck customizing a module's CreateActionsView in order to change the behavior of most create record flows for a module.  Only sometimes would Sugar Developers separately customize the module's CreateView when they noticed the Quick Create flow didn't work the same way.

 



 

Deprecation of CreateActionsView in Sugar 7.7

 

It was clear that we did not need to have a separate layout and view to handle small differences in behavior that also created customization challenges.  Plus after some research, we discovered that the additional create actions (such as Save and View) were hardly ever used!  We decided to eliminate some code and confusion.  So in Sugar 7.7, we've started the process of merging these views together.  When you set the Sugar log level to WARN in Sugar 7.7 (using the Administration Panel), you will see warning messages that the CreateActionsView and CreateActionsLayout are deprecated in your JavaScript console whenever they are used.

 

They will be completely removed in a future release (currently planned for Sugar 7.8).

CreateActionsView is deprecated in Sugar 7.7 and is planned to be completely removed in Sugar 7.8.

 

The benefit is that Sugar Developers will only need to customize a single view to change the behavior of all create record flows.

 

Migrating customizations to CreateView and CreateLayout

 

The action that every Sugar Developer needs to take is to migrate their CreateActionsView  (clients/base/views/create-actions/) customizations to the CreateView (clients/base/views/create/).  This will prepare you for when CreateActionsView is removed completely.

 

This can be as easy as the following two steps:

  1. Copy each custom|modules/.../create-actions/create-actions.js file to custom|modules/.../create/create.js
  2. Change extendsFrom: '*CreateActionsView' to extendsFrom: '*CreateView' within the new files

 

If you were launching the create drawer, then you should use the CreateLayout (create) instead of the CreateActionsLayout (create-actions).

 

For example, use this

app.drawer.open({

 

    layout: 'create',

 

    context: {

 

        create: true,

 

        ...

 

    }

 

});

 

not this

app.drawer.open({

 

    layout: 'create-actions',

 

    context: {

 

        create: true,

 

        ...

 

    }

 

});

Sugar Developers need to customize CreateView for their create dialog customizations in Sugar 7.7 and later

About TethrOn

TethrOn is a mobile field sales and service enablement platform that has a number of different pre-built integrations to back-end systems. The team behind TethrOn recently decided to become a SugarCRM Technology Partner in order to provide connectivity to Sugar with their mobile platform. Their architect gave the experience rave reviews:
Sugar was by far the easiest CRM system to integrate in our experience to date. This is mainly due to the robust set of APIs provided out of the box to support integrations over REST combined with clear documentation on best practices for extending the Sugar v10 REST interface.   In addition, what is provided out of the box is well thought out with respect to useful integration patterns.

 

TethrOn created a proof of concept in 3 weeks and released their production Sugar connector in just 8 weeks!

 



 

If you want to learn more about TethrOn, please visit http://www.tethron.com/.Below David Valko from aMind Solutions, the company behind TethrOn, shares the successful pattern they applied for building their integration to Sugar.

 

Methodology for integrating with Sugar

 

Integration to our TethrOn platform is achieved through the construction of “connector” module that conforms to a uniform interface that TethrOn understands. That module must implement all data operations supported. Here are the 4 steps we followed for rapidly building the SugarCRM connector for TethrOn.

 

Step 1: Understand the Integration Points that Sugar provides for you 

 

Our development team did not have a lot of exposure to SugarCRM, however due to the robust content available on SugarCRM usage, development and integration, our team was able to come up to speed rapidly. We leveraged the many hours worth of recorded online tutorials from Sugar University, as well as online documentation such as the Sugar Developer Guide and other helpful online resources.

 

Specifically in our case, the v10 REST API was a match to our needs, so after grounding the team in Sugar usage and development, we focused much of our attention on the specification for these APIs to get a complete picture of what capabilities are accessible using this method.

 

Step 2: Build the sequence of events and validate

 

To ensure our design was viable, we identified the sequence of API calls that would need to occur to complete each of our integration scenarios. From that we constructed actual calls to the SugarCRM RESTful APIs using a REST client (like cURL or Postman) to ensure our design would function as desired.   These sequences of calls were then translated into actual implementation code and corresponding tests used with our continuous integration environment.

 

Step 3: Identify any gaps in the Sugar RESTful API and extend the APIs only as necessary

 

Over 95% of the functionality we needed was already available in the v10 REST API.   Building out the sequence of events as outlined above helped us to identify the remaining 5%. For these cases, we established a SugarCRM deployable package for our product. The package contains the additional web service endpoints we needed to complete our integration scenarios and is now available through Sugar Exchange.

 

For steps on how to create and modify SugarCRM service endpoints, we followed the instructions for Extending Web Services from the Sugar Developer Guide.

 

Step 4: When extending Sugar, follow the best practices

 

The documentation for extending web services describes in a step-by-step way what is needed to create or modify REST endpoints. However, it is also important to keep in mind other constraints in play that could affect the design of your custom endpoints:

 

In the case of compatibility with Sugar upgrades we took an approach that ensures we make as few assumptions about the current state of Sugar as possible. Specifically we followed these rules:

  • When extending Sugar avoid changing any core code of Sugar
  • Add only the minimal set of new endpoints needed to support the integration scenarios.
  • Given the option of using a “lower level” API or a “higher level” API, choose the “higher level” API. Example: where possible use SugarQuery instead of raw SQL queries to implement your endpoint.

 

Regarding the restrictions on PHP code in Sugar OnDemand environments, we found the most practical approach was to deploy our package to the SugarCRM On-Demand environment provided to us as a SugarCRM Technology Partner and configure our continuous integration tests to run against that environment.

 

Additional best practices for SugarCRM Package development can be found at in the Sugar Exchange Package Guidelines.

Have you checked out Sugar University lately?  SugarCRM provides Hot Topic Webinars designed specifically for Sugar Developers.  This is a great way to keep on top of how to take advantage of latest technology in Sugar and keep those development skills sharp!

 

Sugar 7 Sidecar Essentials Webinar

 

For example, we have an upcoming Sugar 7 Sidecar Essentials Developer Webinar on December 10th at 9:00am PST.  Visit the link to register for this live webinar!  This will be a great one for those just getting their hands dirty with Sugar development or if you have ambitions to become a certified Sugar Developer Specialist.

 

Webinar Recordings

 

If you have been missing them or cannot make it then never fear! Each webinar is recorded and those recordings are available for download via Sugar University.

 

Recent Developer Webinars

 

Here are a couple of recent recordings that many Sugar Developers should find useful.  There are more available and many more coming!

Recording: Configuring and Extending Sugar Logic

Recording: Working with V10 REST API

 

Recent Advanced Workflow (Process Author) Webinars

 

We get a lot of questions from Developers and Administrators about Advanced Workflow (Process Author).   So we have created recorded webinars for that topic too.  Watching these will help you better understand Advanced Workflow capabilities introduced in Sugar Enterprise 7.6.

 

Recording: Advanced Workflow Overview (Process Author)

 

Recording: How to Incorporate Process Author Email Templates and Business Rules

 

Looking for more recordings?

 

Sugar University webinar recordings are typically posted a week or two after the fact.Click here for full list of recorded webinars.