I have field u_date and need to check if the current date is greater to u_date by 15 min.

sachujayakumar
Kilo Contributor

I have field u_date and need to check if the current date is greater to u_date by 15 min.

1 ACCEPTED SOLUTION

 

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 the comment as a correct answer and also helpful if this answers your question.

 

View solution in original post

21 REPLIES 21

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

nope the If loop is not working

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

The If loop is not working..

Okay.

So can you share the logs for me to understand why if condition is not working.