SugarCRM SupportDocumentationSugar DeveloperSugar Developer Guide 8.0ArchitectureLogic HooksAPI Hooksafter_routing



The after_routing hook executes when the v10+ REST Service has found the route for the request.


function after_routing($event, $arguments){}


Name Type Description
event String The name of the logic hook event
arguments Array Additional information related to the event
arguments.api Object The RestService Object
arguments.request Object The RestResponse Object


  • This is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.
  • This hook can change request object parameters that influence routing.
  • This hook should not be used for any type of display output.

Change Log

Version Note
7.0.0RC1 Added after_routing hook




    $hook_version = 1;
    $hook_array = Array();

    $hook_array['after_routing'] = Array();
    $hook_array['after_routing'][] = Array(
        //Processing index. For sorting the array.

        //Label. A string value to identify the hook.
        'after_routing example', 

        //The PHP file where your class is located.

        //The class the method is in. 

        //The method to call. 




    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class logic_hooks_class
        function after_routing_method($event, $arguments)


Last modified: 2018-04-26 03:57:24