You need to sign in to do that
Don't have an account?
Email Notification When the Scheduled Job End date is Approaching
Hi ,
Can anyone help me in sample code for the following scenario like:
- When ever the Scheduled jobs end date is approaching, an email notification should be fired to the User and
- What is the best practice to be followed for nearing end date for a job?
NOTE: I understand that through the normal UI, there is no way for the same. Infact we can create logic using Message.SingleEmail method in the class that implements Database.Batchable<:sObject>.
Following this link for referenec:
>> http://www.fishofprey.com/2012/03/salesforce-sending-notification-when.html
I was trying the sample code. However Any other ideas would be more helpful to achieve this.
Thanku All
Can anyone help me in sample code for the following scenario like:
- When ever the Scheduled jobs end date is approaching, an email notification should be fired to the User and
- What is the best practice to be followed for nearing end date for a job?
NOTE: I understand that through the normal UI, there is no way for the same. Infact we can create logic using Message.SingleEmail method in the class that implements Database.Batchable<:sObject>.
Following this link for referenec:
>> http://www.fishofprey.com/2012/03/salesforce-sending-notification-when.html
I was trying the sample code. However Any other ideas would be more helpful to achieve this.
Thanku All
You can write a trigger for your requirement and get the scheduled jobs details using the SOQL from crontriggers as described in the below link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
get the results from the query and check the end dates and accordingly send the email using the messaging class .
Thanks