SugarCRM Developers on Twitter

CreateActionsView changes in Sugar 7.7.0

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.

Create with actions

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.

Create without actions

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.

Relationship between CreateActionsView and CreateView in Sugar 7.6 and previous

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:

Copy each custom|modules/.../create-actions/create-actions.js file to custom|modules/.../create/create.js

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).

Like this:

Related

Matthew Marum

Matt is the Director of Developer Advocacy for SugarCRM. Previously he was an Engineer on Sugar 7 and a Solutions Architect for the OEM program. He is also an avid trail runner, Boston Marathon qualifier and a karaoke aficionado.

But as Jeff suggested it would be great if we can keep create-actions view and remove create view instead. Because create-actions view customization are very common and it will take a lot of effort to do this change in already existing 7.x deployments.

Thanks everyone. We’ve added a Sugar 7.7.0 upgrade script that will migrate create-actions view/layout code customizations to create view/layout. This will mean that the majority of create-actions customizations installed on existing Sugar 7 instances will be migrated automatically. This will provide a lot of savings in time and development costs to Sugar customers and Sugar Developers. I’ll share some more details in an upcoming blog post.