AnsweredAssumed Answered

Why my custom scheduler is not running?

Question asked by Itzel Cordero on Feb 6, 2020
Latest reply on Feb 28, 2020 by Rolustech Support

I'm doing a custom scheduler to do a soft delete to a table and when i upload the package to sugar it doesn't show any error but it's not running. The status is active and there's no last execution. Also, the LBL does not show in the dropdown it's just a blank space. Here's a screenshot:

Here's my code

soft_delete_wsmonitor.php which is the custom scheduler:

 

<?php

array_push($job_strings, 'soft_delete_wsmonitor');
function soft_delete_wsmonitor()
{
global $db;
$conn = $db->getConection();
$query = "UPDATE wsmon_wsmonitor SET deleted = 1 WHERE date_entered < DATE_SUB(NOW(), INTERVAL 3 MONTH) LIMIT 50";
try {
$conn->executeQuery($query);
}
catch (DBALException $e) {
$GLOBALS['log']->fatal($e->getMessage());
} finally {
$conn->disconnect();
}
return true;
}

 

es_LA.soft_delete_wsmonitor.php which is the label extension file:

 

<?php

$mod_strings['LBL_CUSTOM_JOB'] = 'Soft Delete WSMonitor Records';

Outcomes