- 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-19-2019 02:48 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 11:17 PM
This field is on the incident form so how catalog ui policy will work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 11:42 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 03:16 AM
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.
Mark the comment as a correct answer and also helpful if this answers your question.