‹ jan0sch.de

Implementing your own scheduler functions for SugarCRM

2012-06-03

If you want to implement custom scheduler functions for SugarCRM you should create the file custom/modules/Schedulers/_AddJobsHere.php and implement your functions there:

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

  array_push($job_strings, 'my_task');

  /**
   * Description of what my_task does.
   *
   * @return boolean Returns TRUE on success and FALSE otherwise.
   */
  function my_task() {
    // Add your code here.
    return TRUE;
  }
?>

Afterwards you’ll have to create the appropriate language file (e.g. custom/Extension/modules/Schedulers/Ext/Language/en_us.custom.php) to make the task show up by a human readable name in the sugar scheduler configuration.

<?php
$mod_strings['LBL_MY_TASK'] = 'My own sugarcrm scheduler task :-)';
?>

Don’t forget to execute the quick repair command after adding the files to your sugarcrm installation.