- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 03:59 AM
Hello experts,
i have a use case
I have a time value example : var x="30-11-2023 12:35:00"//just a sample value.
The day the scheduled job runs which will be gs.nowDateTime() ex var y=" 30-11-2023 12:37:00"
If the day the schedule job runs , exceeds the var x like if it passes that value, i need to trigger a mail. Example above will triigger a mail
The mail part can be triggered but i am unable to check for the exceeding time limit condition. Can anyone help me to write that logic.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 04:44 AM
Hi @deepika46,
you try below logic it.
var x="30-11-2023 12:35:00"//just a sample value.
var y=" 30-11-2023 12:37:00"
var sampleDate = new GlideDateTime(x);
var scheduledJobRunDate = new GlideDateTime(y);
if(sampleDate < scheduledJobRunDate){
gs.eventQueue('<event.name>',null,"sys_id of user to whom you need to send email","sys_id of user to whom you need to send email");
}
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 04:44 AM
Hi @deepika46,
you try below logic it.
var x="30-11-2023 12:35:00"//just a sample value.
var y=" 30-11-2023 12:37:00"
var sampleDate = new GlideDateTime(x);
var scheduledJobRunDate = new GlideDateTime(y);
if(sampleDate < scheduledJobRunDate){
gs.eventQueue('<event.name>',null,"sys_id of user to whom you need to send email","sys_id of user to whom you need to send email");
}
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.