function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
franklin_atxfranklin_atx 

Apex Trigger/Class on a Scheduled Field Update

I'm new to writing triggers/classes and I'm looking for a way to update a text field with "date.now()" on a single lead record every hour. I see there is a scheduler but not sure how to implement that into the trigger's logic. Not sure if this logic is correct. 

 

public class LDate {

   public static void addLDate (LEAD[] accs){

      for (LEAD l:accs){
         if (l.Date__c != 'date.now()') {l.ELQDate__c = 'date';
         }
      }
   }

}