You need to sign in to do that
Don't have an account?
Nicolas Bock
How to tr
Hey,
Here's my use-case :
I want Salesforce to automatically fire an email when a field is changed in the User Object.
So I'm using an Apex Trigger to do that.
The only problem is that I want the email to be sent 24 hours after the field has changed and I'm struggling to find a way to do so...
Is there a way to delay an action called by an apex trigger ?
Thanks !
Hi Nicolas,
You need to create a Schedule Job that would run every day or twice a day. The schedule job will query all the User's record get updated in last 24 hours and send an email accordingly.
Thanks,
Gaurav
Skype: gaurav62990
Hi Nicolas,
You Can do this by using schedule apex job so that on every 24 hours the mail gets sent when a particular user field gets updated.
There is no need to write trigger for this situation.
You can take help by this below links for building schedule job,
https://help.salesforce.com/articleView?id=code_schedule_batch_apex.htm&type=5
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
Thanks,
Akshay