- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 02:46 AM
I have field u_date and need to check if the current date is greater to u_date by 15 min.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 04:26 AM
Okay. Then simply make the BR to display query instead of after insert.
Then your Br executes whenever you open the incident. And if the incident u_date+15 minutes is more than current date, then you can show the message saying
gs.addInfoMessage("Current date is greater than u_date");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 02:01 AM
Hi
Go with this -
var gdt = new GlideDateTime(current.u_date);
gdt.addSeconds(900);
var gdt1 = new GlideDateTime();
if(gdt1> gdt) {
gs.log("current date is greater");
}
Hope this helps.
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 02:38 AM
nope the If loop is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 02:48 AM
Hi
Go with this -
var gdt = new GlideDateTime(current.u_date);
gdt.addSeconds(900);
var gdt1 = new GlideDateTime();
if(gdt1.getDate() > gdt.getDate()) {
gs.log("current date is greater");
}
Hope this helps.
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 03:43 AM
The If loop is not working..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 02:18 AM
Okay.
So can you share the logs for me to understand why if condition is not working.
Mark the comment as a correct answer and also helpful if this answers your question.