SugarCRM SupportDocumentationSugar DeveloperSugar Developer Guide 8.0ArchitectureLogic HooksApplication Hooksserver_round_trip



Executes at the end of every page.


function server_round_trip($event, $arguments){}


Name Type Description
event String The current event
arguments Array Additional information related to the event (typically empty)


  • This is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.
  • If you are intending to write display logic to the screen, you must first wrap the display logic in an if condition to prevent breaking the Ajax page loads:
    if (!isset($_REQUEST["to_pdf"]) || $_REQUEST["to_pdf"] == false)
        //display logic
  • This hook is executed on all page loads.
  • Application hooks do not make use of the $bean argument.

Change Log

Version Note
5.0.0a Added server_round_trip hook.




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

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

        //Label. A string value to identify the hook.
        'server_round_trip 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 application_hooks_class
        function server_round_trip_method($event, $arguments)
            //display logic should check for $_REQUEST["to_pdf"]


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