);
Next, create the hook class:
./custom/application_hook.php
<?php
    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    class ApplicationHookConsumer
    {
        function before_method($bean, $event, $arguments)
        {
            //logic
        }
    }
?>
Finally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the customizations will be compiled into ./custom/application/Ext/LogicHooks/logichooks.ext.php. Your logic hook will run before saving records in any module.
Module Loadable Package
When building a module loadable package, you can use the $installdefs['hookdefs'] index to install the extension file.
Installdef Properties
Name
Type
Description


Installdef Properties
Name
Type
Description
from
String
The basepath of the file to be installed.
to_module
String
The key of the module the file is to be installed to.
The example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Action View Map file to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the hook class file, however Sugar will automatically execute Rebuild Extensions to reflect the new logic hook in the system.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'actionView_example',
    'hookdefs' => array(
        array(


'hookdefs' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/application/Ext/LogicHooks/<file>.php',
            'to_module' => 'application',
        )
    ),
    'copy' => array(
        array(
            'from' => '<basepath>/Files/custom/application_hook.php',
            'to' => 'custom/application_hook.php',
        ),
    )
);
Alternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.


Alternative Installdef
Although not recommended, you could utilize the $installdefs['logic_hooks'] index to deploy a logic hook to the system. Please note that there are a couple caveats to this installation method:
The $installdefs['logic_hooks'] index method only works for module-based logic hooks.
The $installdefs['logic_hooks'] index method installs to ./custom/modules/<module>/logic_hooks.php, which is not part of the Extension framework.
Properties
Name
Type
Description
module
String
The key of the module for the logic hook to be installed to.
hook
String
The type of logic hook to be installed.
order
Integer
The number in which the logic hook should run.
description
String
A description of the logic hook to be installed.
file
String


description
String
A description of the logic hook to be installed.
file
String
The file path which contains the logic hook class.
class
String
The class which houses the logic hook functionality.
function
String
The function the logic hook will execute.
The example below will demonstrate the $installdefs['logic_hooks'] index in the ./manifest.php file, in order to add an after save logic hook to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the hook class file.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'actionView_example',
    'logic_hooks' => array(
        array(


'logic_hooks' => array(
        array(
            'module' => '<module>',
            'hook' => 'after_save',
            'order' => 1,
            'description' => 'Example After Save LogicHook',
            'file' => 'custom/modules/<module>/module_hook.php',
            'class' => '<module>HookConsumer'
            'function' => 'after'
        )
    ),
    'copy' => array(
        array(
            'from' => '<basepath>/Files/custom/modules/<module>/module_hook.php',
            'to' => 'custom/modules/<module>/module_hook.php',
        ),
    )
);
  	Last modified: 2023-02-03 21:04:03


Modules
Overview
The Modules extension maps additional modules in the system, typically when Module Builder deploys a module.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Application
Sugar Variable
$beanList, $beanFiles, $moduleList
Extension Directory
./custom/Extension/application/Ext/Include/
Compiled Extension File
./custom/application/Ext/Include/modules.ext.php
Manifest Installdef
$installdefs['beans']
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System


The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Include/ to register a new module in the system. This extension is normally used when deploying custom modules. The example below shows what this file will look like after a module is deployed:
./custom/Extension/application/Ext/Include/<file>.php
<?php
$beanList['cust_module'] = 'cust_module';
$beanFiles['cust_module'] = 'modules/cust_module/cust_module.php';
$moduleList[] = 'cust_module';


$moduleList[] = 'cust_module';
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/Include/modules.ext.php.
Module Loadable Package
When building a module loadable package, you can use the $installdefs['beans'] index to install the extension file.
Installdef Properties
Name
Type
Description
module
String
The key of the module to be installed
class
String
The class name of the module to be installed
path
String
The path to the module's class
tab
Boolean
Whether or not the module will have a navigation tab (defaults to false)


Boolean
Whether or not the module will have a navigation tab (defaults to false)
The example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add a custom module to the system. When using this approach, you still need to use the $installdefs['copy'] index for Module directory, however, Sugar will automatically execute the database table creation process, relationship table creation process, as well as Rebuild Extensions to reflect the new Module in the system.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'Beans_Example',
    'beans' => array(
        array(
            'module' => 'cust_Module',
            'class' => 'cust_Module',


'class' => 'cust_Module',
            'path' => 'modules/cust_Module/cust_Module.php',
            'tab' => true
        )
    ),
    'copy' => array(
        array(
            'from' => '<basepath>/Files/modules/cust_Module',
            'to' => 'modules/cust_Module'
        )
    )
);


)
    )
);
Alternatively, you may use theÂ $installdefs['copy']Â index for copying the Modules definition file into the ./custom/Extension/application/Ext/Include/Â directory. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more informationÂ on theÂ $installdefs['copy']Â index and module loadable packages, please refer to theÂ Introduction to the ManifestÂ page.
  	Last modified: 2023-02-03 21:04:03


Include
Overview
The Modules extension maps additional modules in the system, typically when Module Builder deploys a module.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Application
Sugar Variable
$beanList, $beanFiles, $moduleList
Extension Directory
./custom/Extension/application/Ext/Include/
Compiled Extension File
./custom/application/Ext/Include/modules.ext.php
Manifest Installdef
$installdefs['beans']
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System


This page refers to content that is only available in modules running in backward compatibility mode.
Layoutdefs
Overview
The Layoutdefs extension adds or overrides subpanel definitions.
Note: This extension is only applicable to modules running in backward compatibility mode.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Module
Sugar Variable
$layout_defs
Extension Directory
./custom/Extension/modules/<module>/Ext/Layoutdefs/
Compiled Extension File
./custom/<module>/Ext/Layoutdefs/layoutdefs.ext.php
Manifest Installdef
$installdefs['layoutdefs']
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System


The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/modules/<module>/Ext/Layoutdefs/ to add Layout Definition files to the system. The following example will add a subpanel definition for a module relationship:
./custom/Extension/modules/<module>/Ext/Layoutdefs/<file>.php
<?php
$layout_defs["<module>"]["subpanel_setup"]['<subpanel key>'] = array (
    'order' => 100,
    'module' => '<related module>',
    'subpanel_name' => 'default',
    'sort_order' => 'asc',
    'sort_by' => 'id',


'sort_by' => 'id',
    'title_key' => 'LBL_SUBPANEL_TITLE',
    'get_subpanel_data' => '<subpanel key>',
    'top_buttons' => array (
        array (
          'widget_class' => 'SubPanelTopButtonQuickCreate',
        ),
        array (
          'widget_class' => 'SubPanelTopSelectButton',
          'mode' => 'MultiSelect',
        ),
    ),
);
Please note that, if you are attempting to override parts of an existing subpanel definition, you should specify the exact index rather than redefining the entire array. An example of overriding the subpanel top_buttons index is shown below:
<?php


<?php
$layout_defs["<module>"]["subpanel_setup"]["<subpanel key>"]["top_buttons"] = array(
    array(
        'widget_class' => 'SubPanelTopButtonQuickCreate',
    ),
);
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customizations to ./custom/modules/<module>/Ext/Layoutdefs/layoutdefs.ext.php .
Module Loadable Package
When building a module loadable package, you can use the $installdefs['layoutdefs'] index to install the extension file.
Installdef Properties
Name
Type
Description
from
String
The base path of the file to be installed
to_module
String
The key for the module where the file will be installed


to_module
String
The key for the module where the file will be installed
The example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Layout Definition Extension file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the customizations added with the Layout definition.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'layoutdefs_Example',
    'layoutdefs' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/modules/<module>/Ext/Layoutdefs/<file>.php',
            'to_module' => '<module>',
        )
    )
);


)
    )
);
Alternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.
  	Last modified: 2023-02-03 21:04:03


This page refers to content that is only available in modules running in backward compatibility mode.
TinyMCE
Overview
The TinyMCE extension affects the TinyMCE WYSIWYG editor's configuration for backward compatible modules such as PDF Manager and Campaign Email Templates.
To review the default configuration for TinyMCE, please refer to the code in ./include/SugarTinyMCE.php. Sidecar's TinyMCE configuration can be edited using the Sidecar Framework and editing the htmleditable_tinymce field.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Application
Sugar Variable
$defaultConfig, $buttonConfigs, $pluginsConfig
Extension Directory
./custom/Extension/application/Ext/TinyMCE/
Compiled Extension File


Compiled Extension File
./custom/application/Ext/TinyMCE/tinymce.ext.php
Manifest Installdef
$installdefs['tinymce']
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/TinyMCE/ to customize the TinyMCE configuration. The following example will increase the height of the TinyMCE window, remove buttons, and remove plugins from the WYSIWYG Editor:
./custom/Extension/application/Ext/TinyMCE/<file>.php
<?php
$defaultConfig['height'] = '1000';
$buttonConfigs['default'] = array(


$buttonConfigs['default'] = array(
    'buttonConfig' => "bold,italic,underline,strikethrough,separator,bullist,numlist",
    'buttonConfig2' => "justifyleft,justifycenter,justifyright,justifyfull",
    'buttonConfig3' => "fontselect,fontsizeselect",
);
$pluginsConfig['default'] = 'advhr,preview,paste,directionality';
Navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/TinyMCE/tinymce.ext.php
Module Loadable Package
When building a module loadable package, you can use the $installdefs['tinymce'] index to install the extension file.
Installdef Properties
Name
Type
Description


Installdef Properties
Name
Type
Description
from
String
The base path of the file to be installed
The example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add the UserPage file to the system. You should note that when using this approach Sugar will automatically execute Rebuild Extensions to reflect the changes to TinyMCE in the system.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'tinyMCE_Example',
    'tinymce' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/application/Ext/TinyMCE/<file>.php',
            'to_module' => 'application'
        )
    )
);


'to_module' => 'application'
        )
    )
);
Alternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module loadable packages, please refer to the Introduction to the Manifest page.
  	Last modified: 2023-02-03 21:04:03


Extensions
Overview
This extensionÂ allows for developers to create custom extensions within the framework. Custom extensions are used alongside the extensions found in ./ModuleInstaller/extensions.php.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Application
Sugar Variable
$extensions
Extension Directory
./custom/Extension/application/Ext/Extensions/
Compiled Extension File
./custom/application/Ext/Extensions/extensions.ext.php
Manifest Installdef
$installdefs['extensions']
Parameters
section : Section name in the manifest file
extdir : The directory containing the extension files
file : The name of the file where extension files are compiled into
module : Determines how the framework will interpret the extension (optional)


module : Determines how the framework will interpret the extension (optional)
<Empty> : Will enable the extension for all modules
ExtÂ : ./custom/Extension/modules/<module>/Ext/<Custom Extension>/
Ext File : ./custom/modules/<module>/Ext/<Extension Name>.ext.php
<Specific Module> : Will enable the extension for the specified module
Ext Directory : ./custom/Extension/modules/<Specific Module>/Ext/<Custom Extension>/
Ext File : ./custom/modules/<Specific Module>/Ext/<Extension Name>.ext.php
Application : enables the extension for application only
Ext Directory : ./custom/Extension/application/Ext/<Custom Extension>/
Ext File : ./custom/application/Ext/<Custom Extension>/<Extension Name>.ext.php
Implementation


Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Extensions/ to map a new extension in the system. The following example will create a new extension called "example", which is only enabled for "application":
./custom/Extension/application/Ext/Extensions/<file>.php
<?php
$extensions['example'] = array(
    'section' => 'example',
    'extdir' => 'Example',
    'file' => 'example.ext.php',
    'module' => 'application' //optional paramater
);


'module' => 'application' //optional paramater
);
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will rebuild the extensions and compile your customization into ./custom/application/Ext/Extensions/extensions.ext.php. Then you will be able to add your own extension files in Â ./custom/Extension/application/Ext/Example/.
Module Loadable Package
When building a module loadable package, you can use the $installdefs['extensions'] index to install the extension file.
Installdef Properties
Name
Type
Description
from
String
The base path of the file to be installed


Name
Type
Description
from
String
The base path of the file to be installed
The example below will demonstrate the proper install definition that should be used in the ./manifest.php file in order to add the Extension file to the system. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new Extension in the system.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'customExtension_Example',
    'extensions' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/application/Ext/Extensions/<file>.php'
        )
    )
);


)
    )
);
Alternatively, you may use theÂ $installdefs['copy']Â index for the Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more informationÂ on theÂ $installdefs['copy']Â index and module-loadable packages, please refer to theÂ Introduction to the ManifestÂ page.
  	Last modified: 2023-02-03 21:04:03


This page refers to content that is only available in modules running in backward compatibility mode.
ActionReMap
Overview
The ActionReMap extension maps new actions to existing actions. This extension is only applicable to modules running in backward compatibility mode.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Module
Sugar Variable
$action_remap
Extension Directory
./custom/Extension/modules/<module>/Ext/ActionReMap/
Compiled Extension File
./custom/<module>/Ext/ActionReMap/action_remap.ext.php
Manifest Installdef
$installdefs['action_remap']
Implementation
The following sections illustrateÂ the various ways to implement a customization to a Sugar instance.
File System


File System
When working directly with the file system, you can create a file in Â ./custom/Extension/modules/<module>/Ext/ActionReMap/ to map an action to another defined action. The following example will map the action 'example' to 'detailview':
./custom/Extension/modules/<module>/Ext/ActionReMap/<file>.php
<?php
$action_remap['example'] = 'detailview';
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization intoÂ ./custom/modules/<module>/Ext/ActionReMap/action_remap.ext.php.
Module Loadable Package
When building a module loadable package, you can use the $installdefs['action_remap'] index to install the extension file.Â


Installdef Properties
Name
Type
Description
from
String
The basepath of the file to be installed
to_module
String
The key for the module where the file will be installed
The example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Action Remap file to a specific module. You should note that when using this approach, Sugar will automatically execute Rebuild ExtensionsÂ to reflect your changes in the system.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'ActionRemap_Example',
    'action_remap' => array(
        array(


'action_remap' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/modules/<module>/Ext/ActionReMap/<file>.php',
            'to_module' => '<module>',
        )
    )
);
Alternatively, you may use theÂ $installdefs['copy']Â index. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more informationÂ on theÂ $installdefs['copy']Â index and module-loadable packages, please refer to theÂ Introduction to the ManifestÂ page.
  	Last modified: 2023-02-03 21:04:03


JSGroupings
Overview
The JSGroupings extensionÂ allows for additional JavaScript grouping files to be created or added to existing groupings within the system.
JSGroupings are file packages containing one or more minified JavaScript libraries. The groupings enhance system performance by reducing the number of JavaScript files that need to be downloaded for a given page. Some examples of JSGroupings in Sugar are sugar_sidecar.min.js, which contains the Sidecar JavaScript files, and sugar_grp1.js, which contains the base JavaScript files.
You can find all of the groups listed in ./jssource/JSGroupings.php. Each group is loaded only when needed by a direct call (e.g., from a TPL file). For example, sugar_grp1.js is loaded for almost all Sugar functions, while sugar_grp_yui_widgets.js will usually be loaded for just record views.


To load a JSGroupings file for a custom module, simply add a new JSGrouping and then include the JavaScript file for your custom handlebars template. You can also append to an existing grouping, such as ./include/javascript/sugar_grp7.min.js, to include the code globally.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Application
Sugar Variable
$js_groupings
Extension Directory
./custom/Extension/application/Ext/JSGroupings/
Compiled Extension File
./custom/application/Ext/JSGroupings/jsgroups.ext.php
Manifest Installdef
$installdefs['jsgroups']Â
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System


The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
Creating New JSGroupings
When working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/JSGroupings/ to add or append Javascript to JSGroupings in the system. The following example will add a new JSGrouping file to the system:
./custom/Extension/application/Ext/JSGroupings/<file>.php
<?php
//creates the file cache/include/javascript/newGrouping.js
$js_groupings[] = $newGrouping = array(
    'custom/file1.js' => 'include/javascript/newGrouping.js',
    'custom/file2.js' => 'include/javascript/newGrouping.js',
);


);
Next, create the Javascript files that will be grouped as specified in the JSGrouping definition above:
./custom/file1.js
function one(){
    //logic
}
./custom/file2.js
function two(){
    //logic
}
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/JSGroupings/jsgroups.ext.php.
Finally, navigate to Admin > Repair > Rebuild JS Grouping Files. This will create the grouping file in the cache directory as specified:
./cache/include/javascript/newGrouping.js
function one(){}/* End of File custom/file1.js */function two(){}/* End of File custom/file2.js */
Appending to Existing JSGroupings


Appending to Existing JSGroupings
In some situations, you may find that you need to append your own JavaScript to a core Sugar JSGrouping. Similarly to creating a new JSGrouping, to append to a core JSGrouping you can create a new PHP file in ./custom/Extension/application/Ext/JSGroupings/. The example below demonstrates how to add the file ./custom/file1.js to ./cache/include/javascript/sugar_grp7.min.js.
./custom/Extension/application/Ext/JSGroupings/<file>.php
<?php
//Loop through the groupings to find grouping file you want to append to
foreach ($js_groupings as $key => $groupings)
{
    foreach  ($groupings as $file => $target)
    {
    	//if the target grouping is found


{
    	//if the target grouping is found
        if ($target == 'include/javascript/sugar_grp7.min.js')
        {
            //append the custom JavaScript file
            $js_groupings[$key]['custom/file1.js'] = 'include/javascript/sugar_grp7.min.js';
        }
        break;
    }
}
Next, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/JSGroupings/jsgroups.ext.php.
Module Loadable Package
When building a module loadable package, you can use the $installdefs['jsgroups'] index to install the extension file.
Installdef Properties
Name
Type
Description
from
String


Installdef Properties
Name
Type
Description
from
String
The basepath of the file to be installed
to_module
String
The key for the module where the file will be installed
The example below demonstrates the proper install definition that should be used in the ./manifest.php file to add the JSGrouping Extension file to the system. When using this approach, you still need to use the $installdefs['copy'] index for the custom JavaScript files you are adding to JSGroupings. Sugar will automatically execute Rebuild Extensions to reflect the new JSGrouping, however, you will still need to navigate to Admin > Repair > Rebuild JS Grouping Files, to create the grouping file in the cache directory.
./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(


...
);
$installdefs = array(
    'id' => 'jsGroupings_Example',
    'jsgroups' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/application/Ext/JSGroupings/<file>.php',
            'to_module' => 'application',
        )
    ),
    'copy' => array(
        array(
            'from' => '<basepath>/Files/custom/file1.js',
            'to' => 'custom/file1.js'
        ),
        array(
            'from' => '<basepath>/Files/custom/file2.js',
            'to' => 'custom/file2.js'
        )
    )
);


)
    )
);
Alternatively, you may use theÂ $installdefs['copy']Â index for the JSGrouping Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more informationÂ on theÂ $installdefs['copy']Â index and module-loadable packages, please refer to theÂ Introduction to the ManifestÂ page.
Considerations
The grouping path you specify will be created in the cache directory.
If you wish to add a grouping that contains a file that is part of another group already, add a '.' after <file>.js to make the element key unique.
  	Last modified: 2023-02-03 21:04:03


UserPage
Overview
The UserPage extension adds sections to the User Management view.
Properties
The following extension properties are available.Â For more information, please refer to the Extension Property documentation.
Property
Value
Extension Scope
Module: Users
Extension Directory
./custom/Extension/modules/Users/Ext/UserPage/
Compiled Extension File
./custom/Users/Ext/UserPage/userpage.ext.php
Manifest Installdef
$installdefs['user_page']
Implementation
The following sections illustrate the various ways to implement a customization to a Sugar instance.
File System
When working directly with the filesystem, you can create a file in ./custom/Extension/modules/Users/Ext/UserPage/ to add custom elements to the User page. The following example will add a custom table to the Users module's detail view:


./custom/Extension/modules/Users/Ext/UserPage/<file>.php
<?php
$HTML=<<<HTML

                    <slot>Header</slot>

                    Content

HTML;
    echo $HTML;


</tbody>
    </table>
HTML;
    echo $HTML;
Navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules/Users/Ext/UserPage/userpage.ext.php
Module Loadable Package
When building a module loadable package, you can use the $installdefs['user_page'] index to install the extension file.
Installdef Properties
Name
Type
Description
from
String
The base path of the file to be installed
The example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the UserPage file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the changes to the User view in the system.
./manifest.php
<?php
$manifest = array(


./manifest.php
<?php
$manifest = array(
    ...
);
$installdefs = array(
    'id' => 'userPage_Example',
    'user_page' => array(
        array(
            'from' => '<basepath>/Files/custom/Extension/modules/Users/Ext/UserPage/<file>.php',
        )
    )
);
Alternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.
  	Last modified: 2023-02-03 21:04:03


Backward Compatibility
Overview
As of SugarÂ® 7, modules are built using the Sidecar framework. Any modules that still use the MVC architecture and have not yet migrated to the Sidecar framework are set in what Sugar refers to as "backward compatibility" (BWC) mode.
For the list of Studio-enabled modules in backward compatibility for your version of Sugar, please refer to the User Interface (Legacy Modules) documentation for your version of Sugar.
URL Differences
There are some important differences between the legacy MVC and Sidecar URLs. When a module is set in backward compatibility, the URL will contain "/#bwc/" in the path and use query string parameters to identify the module and action. An example of the Sidecar BWC URL is shown below.
http://{site url}/#bwc/index.php?module=<module>&action=<action>


You can see that this differs from the standard route of:
http://{site url}/#<module>/<record id>
Studio Differences
There are some important differences between the legacy MVC modules and Sidecar modules. When a module is in backward compatibility mode, an asterisk is placed next to the modules name in Studio. Modules in backward compatibility will use the legacy MVC metadata layouts, located in ./modules/<module>/metadata/, as follows:
Layouts
Edit View
Detail View
List View
Search
Basic Search
Advanced Search
These layouts differ from Sidecar in many ways. The underlying metadata is very different and you should notice that the MVC layouts have a separation between the Edit View and Detail View whereas the Sidercar layouts make use of the Record View. The Sidecar metadata for Sugar is located in ./modules/<module>/clients/base/views/.
Layouts
Record View


Layouts
Record View
List View
Search
Search
TopicsEnabling Backward CompatibilityHow to enable backward compatibility for modules.Converting Legacy Modules To SidecarHow to upgrade a legacy module to be Sidecar enabled.
  	Last modified: 2023-02-03 21:04:03


Converting Legacy Modules To Sidecar
How to upgrade a legacy module to be Sidecar enabled.
Overview
After upgrading your instance to Sugar 7.x, some custom modules may be left in the legacy backward compatible format. This is normally due to the module containing a custom view or file that Sugar does not recognize as being a supported customization for Sidecar. To get your module working with Sidecar, you will need to remove the unsupported customization and run the UpgradeModule.php script.
Note:Â The following commands should be runÂ on a sandbox instance before being applied to any production environment. It is also important to note that this script should only be run against custom modules. Stock modules in backward compatibility should remain in backward compatibility.
Steps to Complete
The following steps require access to both the Sugar filesystem as well as an administrative user.


The following steps require access to both the Sugar filesystem as well as an administrative user.
Note:Â As of Sugar 10.0,Â the UpgradeModule.php script has been removed from the codebase. We are providing a zip of the files that were removed so that it is still possible to run the upgrade.
Begin by downloading this zip file that contains the previously removed code
Unzip the file and move the contents into your Sugar application at ./modules/UpgradeWizard/
To upgrade aÂ custom module, identify the module's unique key. This key can be easily found by identifying the module's folder name in ./modules/<module key name>/. The module's key name will be in the format of abc_module.Â


Next, change to theÂ ./modules/UpgradeWizard/Â path relative to your Sugar root directory in your terminal or command line application:cd <sugar root>/modules/UpgradeWizard/
Run theÂ UpgradeModule.phpÂ script, passing in theÂ sugar root directory andÂ the unique key of the legacy module:php UpgradeModule.php <sugar root> <module key>
An example is shown below:php UpgradeModule.php /var/www/html/sugarcrm/ abc_module
The script with then output a series of messages identifying issues that need to be corrected. Once the issues have been addressed, you can then run theÂ UpgradeModule.phpÂ script again to confirm no errors have been found.


Once completed, log into your instance and navigate to Admin > Repair > Quick Repair and Rebuild. Test the customÂ module to ensure itÂ is working as expected. There is noÂ guarantee that the module will be fully functional in Sidecar and may therefore require additional development effort to ensure compatibility.
  	Last modified: 2023-02-03 21:04:03


Enabling Backward Compatibility
Overview
How to enable backward compatibility for a module.
Enabling Backward Compatibility
Backward Compatibility Mode is not a permanent solution for modules with legacy customizations. If you should need to temporarily get a module working due to legacy customizations, you can follow the steps below to enable the legacy MVC framework.Â Please note that switching stock Sugar modules from the Sidecar framework to backward compatibilityÂ mode is not supported and may result in unexpected behaviors in the application.
Enabling BWC
To enable backward compatibility, you must first create a file in ./custom/Extension/application/Ext/Include/ for the module. If the module is custom, there will already be an existing file in this folder pertaining to the module that you can edit.
./custom/Extension/application/Ext/Include/<file>.php
<?php
$bwcModules[] = '<module key>';


<?php
$bwcModules[] = '<module key>';
Once the file is in place, you will need to navigate to Admin > Repair > Quick Repair and Rebuild. The Quick Repair can wait until you have completed the following sections for this customization.
Verifying BWC Is Enabled
To verify that backward compatibility is enabled, you can inspect App.metadata.get().modules after running a Quick Repair and Rebuild in your browser's console window:
Using Developer Tools in Google Chrome
Open Developer Tools
This can be done in the following ways:
Command + Option + i
View > Developer > Developer Tools
Right-click on the web page and selecting "Inspect Element"
Select the "Console" tab
Run the following command, replacing <module key> and verify that it returns true:
App.metadata.get().modules.<module key>.isBwcEnabled
Using Firebug in Google Chrome or Mozilla Firefox


Using Firebug in Google Chrome or Mozilla Firefox
Open Firebug
Select the "Console" tab
Run the following command, replacing <module key>, and verify that it returns true:
App.metadata.get().modules.<module key>.isBwcEnabled
  	Last modified: 2023-02-03 21:04:03