Send a reminder email before End date is due

WaledBajukhaif
Tera Expert

We have a request to create a field "xyz" to enter number of days in [ast_contract] table, this field will count how many days left to "End Date" field. then send a notification/reminder to "Manager" field.

 

Ex: a contract end date is "31/12/2028", i want to send a notification/reminder to the manager 6 months (or X months) before 31/12/2028. which means i would enter "182" (this is number of days ~6 months) in "xyz" field.

When current date is "01/07/2028" send a notification. (because it's 182 days left to End date).

 

Any help/suggestion would be helpful

Regards

 

 

14 REPLIES 14

@WaledBajukhaif 

Glad to know that approach I shared worked.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@WaledBajukhaif 

for that I already shared approach yesterday

AnkurBawiskar_0-1751454925569.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@WaledBajukhaif 

every contract requires reminder email with varying date?

Like Contract 1 is to be sent 180 days prior to End date, Contract 2 is to be sent 170 days prior to End Date

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Yes every contract reminder is different than the other,,, 1 send a reminder 6 months before end date, other contract 3 months before end date, it depends on the field "xyz" in every contract.

this field can be number or date, whichever easier to achieve the request.

@WaledBajukhaif 

I will suggest to store number of days in that custom field as Integer for better date calculation

then you can use daily scheduled job

1) iterate over all the contracts

2) get contract end date and substract the days present in the custom field -> you will get a date

3) then compare today's date with that date from Step 2

4) if same then send email using gs.eventQueue()

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader