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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

If this is about Client Side, have you considered using a (Catalog) UI Policy to achieve date validations? There's almost no-code needed to achieve date validations this way. Have a look at an article I wrote on this:
No Code date validations thru (Catalog) UI Policies

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

This field is on the incident form so how  catalog ui policy will work.

So did you had a look at the article? It explains how you can do this almost no-code.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

asifnoor
Kilo Patron

try this code

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

var gd = new GlideDateTime(current.u_date);
gd.addSeconds(900);
var gd1 = new GlideDateTime();
if(gd1> gd) {
gs.print("current date is greater");
}

Mark the comment as a correct answer and helpful if this helps.