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
Tara WinhofferTara Winhoffer 

Trying to create a Trigger to clear a field on the First of every month

Hi Community,

I'm an admin who is trying to create a Trigger (my first) that will automatically clear a checkbox field on the first of every month. Any help on this would be very grateful. 

Thanks,
Tara
Raj VakatiRaj Vakati
  Hi Tara , 
If I understood correctly, you need to clear the check box first of every month no matter whether user edits the record or not. For this requirement, you need to use batch apex or scheduler apex or queueable apex jobs. 

Please refer this links 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
https://help.salesforce.com/articleView?id=code_schedule_batch_apex.htm&language=en_us&r=https%3A%2F%2Fwww.google.com%2F&type=5

 
Gururaj BGururaj B
you can create a apex class that is scheduleable and call it once with appropriate time expression like '0 0 0 * * *' which triggeres your class where you should implement your apex code within a method i.e "global void execute(SchedulableContext SC)" to clear a field of your object.
Refer :https://developer.salesforce.com/docs/atlas.en-us.212.0.apexcode.meta/apexcode/apex_scheduler.htm

Please mark as best answer if you feel so.