Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 11:41 AM
Hello,
I have a requirement to send out a notification based on.
- Number of options remaining is greater than zero
- Should be sent 90 days prior to the current period of performance end date
How would I do this in the email notification configuration? Actual steps would be very helpful. Thank you.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:28 PM
You can run a schedule job on daily basis , you can modify below script
var currentDate = new GlideDateTime();
// Calculate the target date (90 days prior to the current period of performance end date)
var targetDate = new GlideDateTime(); // Assuming 'currentRecord' is the record you're working with
targetDate.setDisplayValue(currentRecord.u_period_of_performance_end_date); // Replace with the actual field name
// Calculate the difference in days
var daysDifference = GlideDate.subtract(targetDate, currentDate);
// Check conditions
if (currentRecord.u_options_remaining > 0 && daysDifference > 90) {
// Send notification logic here
gs.eventQueue('notification.event.type', currentRecord, '90 days notification');
}
Please mark my answer correct/helpful if it helps you!
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:28 PM
You can run a schedule job on daily basis , you can modify below script
var currentDate = new GlideDateTime();
// Calculate the target date (90 days prior to the current period of performance end date)
var targetDate = new GlideDateTime(); // Assuming 'currentRecord' is the record you're working with
targetDate.setDisplayValue(currentRecord.u_period_of_performance_end_date); // Replace with the actual field name
// Calculate the difference in days
var daysDifference = GlideDate.subtract(targetDate, currentDate);
// Check conditions
if (currentRecord.u_options_remaining > 0 && daysDifference > 90) {
// Send notification logic here
gs.eventQueue('notification.event.type', currentRecord, '90 days notification');
}
Please mark my answer correct/helpful if it helps you!