Let the platform do the work

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

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(
            '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.

Topics