You need to sign in to do that
Don't have an account?
Tara 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
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
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
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.
For your requirements, Batch Class is the best solution Create a Batch Class it's scheduler class and then schedule it to run for every 1st from the schedule wizard provided by the salesforce
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
https://help.salesforce.com/articleView?id=code_schedule_batch_apex.htm&type=5