AnsweredAssumed Answered

Custom scheduler is not updating records

Question asked by tobydz on Jun 11, 2015
Latest reply on Jun 16, 2015 by tobydz
I have created a custom scheduler job to go in and update certain files in order to keep calculated fields current.  I have built it according to the docs, and it shows up in the UI under the schedule creator, but looking at a report, none of the calculated fields are being updated, and the log file keeps saying this:
Thu Jun 11 17:31:01 2015 [26108][522b14b3-45e2-9408-da3a-4feacc147afa][FATAL] Job 76aea5ae-3229-fa14-f175-557a28828fcb (Update PI Calcs) failed in CRON run

I'm at my wits end here, can someone please help?  Here's is the code:

// Add the job key to the list of job strings
array_push($job_strings, 'UpdatePICalcs');    function UpdatePICalcs()  {      require_once 'data/BeanFactory.php';      require_once 'data/SugarBean.php';        // Get the module bean      $piBean = BeanFactory::getBean('PI_Personal_Injury');            // Get all the modules that aren't deleted      $beanList = $piBean->get_full_list('', "pi_personal_injury_cstm.date_status_changed_c NOT LIKE ''",true);            // If we got a bean list back      if($beanList != null)      {          // Go over each bean and touch it          foreach($beanList as $b)           {                            // Prevent changes to the modified date and user              $b->update_date_modified = false;              $b->update_modified_by   = false;                            // Save the bean              $b->save();           }                    // Return true for success          return true;                }//end if beanList not null            // Return false if failed      return false;        }//end UpdatePICalcs()