I sheduled an apex class to run everyday, but nothing happens. Can somebody help me out?

Viewed 533

I wrote this APEX class and sheduled it to run every day.I don't get an error message, but unfortunately the class doesn't do anything... Can anybody help me out?

global class CustomersDateCheck implements Schedulable {
global void execute(SchedulableContext sc) {
List<Customers__c> CustomerList = [SELECT Id FROM Customers__c];
DateCheck(CustomerList);}

public static void DateCheck(Customers__c[] objects){


  for(Customers__c obj: objects){

    if(obj.DateField > Date.today()){
            continue;}

        else{obj.FlowUpdateHelper__c = true;}
    }
  }
}
2 Answers

The error means you're trying to access something that you didn't include in the query, in this case the Customers__c.DateField__c , you need to either remove the reference to that, or update your query to include that info

Related