Contract Management - Contract Threshold breached Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have a requirement that is
WHEN the Contract is about to reach the end date or expiry
THEN automated notifications or alerts should be sent to abc@email id based on the frequency mentioned below
1. Every week when 1 month is left
2. Everyday when 1 week is left
How to achieve this?
Could you please help me on this?
Thanks,
Pavithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @pavi12
Easy Solution -
Implement a daily Scheduled Script Execution to evaluate records against their expiry date.
Based on the remaining time to expiry, trigger appropriate events, which in turn drive email notifications.
Optimized Solution -
1.Create a Choice field on contract table, for an example - Expiry Phase
Value Meaning
| healthy | > 30 days |
| monthy_warning | 30–8 days |
| weekly_warning | ≤ 7 days |
| expired | < 0 days |
2.Scheduled Script Execution (Daily)
Set the "expiry status" field based on end date or expiry date.
var today = new GlideDate();
var gr = new GlideRecord('u_contract');
gr.addNotNullQuery('expiry_date');
gr.addQuery('expiry_date', '>=', today.getValue() - 1);
gr.query();
while (gr.next()) {
var expiry = new GlideDate();
expiry.setValue(gr.expiry_date);
var daysLeft = GlideDate.subtract(expiry, today).getDayPart();
var newPhase =
daysLeft > 30 ? 'healthy' :
daysLeft > 7 ? 'monthly_warning' :
daysLeft >= 0 ? 'weekly_warning' :
'expired';
if (gr.u_expiry_phase != newPhase) {
gr.u_expiry_phase = newPhase;
gr.update();
}
}3. Business Rule - Fire Event ONLY on Phase Change
4. Notification Logic (Based on Event)
Compute expiry once → store expiry phase→ trigger only on phase change
No daily scanning of all records. No repeated math.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Laveena-Agarwal,
Thanks for the reply.
Already we have the OOTB notification called Contract Threshold breached and also we have clm_condition_check_list
Sample OOTB for 120 days?
Here you can see the event name called contract.expiration.
How we can approach on this clm_condition_checker?
Thanks,
Pavithra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3m ago
Oh in that case , You can follow the steps listed here-