Want to send notification on last day of every month using scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 08:52 AM
Hello Experts,
I want to send a notification on the last day of every month .how can I achieve this using the scheduled job please guide me.
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 09:45 AM
You can create an event that will be triggered by the scheduled job (runs at 30th of each month) and setup notification to be triggered by said event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 09:59 AM - edited ‎03-26-2023 09:59 AM
Hi @--oooo-- ,
Please write schedule script execution and write script to log an event.
gs.eventQueue("event_name", glideRecord object, parm1 ( sys_id of user whom you want to send, parm2 (optional));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 10:43 AM
Hello @Community Alums @Roshan Tiwari ,
I know how to send notifications using Event Queue. I want to send a notification on the last day of the month.
suppose the month is feb then it should send a notification on 28th Feb.
please guide me thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 11:08 AM
Hi @--oooo-- ,
You can use below class: Values I have entered is just for example.
var gdt = new GlideDateTime(); //December
gs.print(gdt.getDaysInMonth());
Output will be 31.
var gdt = new GlideDateTime();
gs.print(gdt.getDayOfMonth());
output will be 2.
Just compare like \:
if(gdt.getDayOfMonth() == gdt.getDaysInMonth()){
"here you find last day of month"
}