AnsweredAssumed Answered

Scheduler custom job

Question asked by Eskender Bilyalov on Feb 4, 2018
Latest reply on Feb 7, 2018 by Francesca Shiekh

How change date color with custom job?

<?php

     array_push($job_strings, 'custom_job');
      function custom_job(){
      global $sugar_config, $timedate;

 

         $db = DBManagerFactory::getInstance();


$prune_interval = !empty($GLOBALS['sugar_config']['sugarfeed_prune_interval']) && is_numeric($GLOBALS['sugar_config']['sugarfeed_prune_interval']) ? $GLOBALS['sugar_config']['sugarfeed_prune_interval'] : 1;


$timeStamp = $db->convert("'". $timedate->asDb($timedate->getNow()->get("-".$prune_interval." days")) ."'" ,"datetime");


$query = "SELECT * FROM parts WHERE date_modified < $timeStamp";
while ($row = $db->fetchByAssoc($query)) {

//How select fields date and change color?

}
$db->query($query);

return true;

?>

Outcomes