- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2014 09:51 AM
I've been reviewing the Using DurationCalculator To Calculate a Due Date - ServiceNow Wiki wiki article to figure out how to set the default for a Catalog variable 'Due Date' to three business days from the 'Requested Date' = javascript:gs.now(). I think I need to create a schedule to incorporate in the scripting that is provided in the wiki article but I'm not sure how to design one that defaults to three weekdays from now. I'm still not too comfortable with scripting to but I think that is what I need, does anyone have any advice?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 09:46 AM
Sorry Lindsey, not having much luck here!
I've tested this and definitely got it this time...
You just need to add the below as a new line at the top of your script:
javascipt:
So it will look something like:
javascript:
// Get the datetime now
var nowGdt = new GlideDateTime();
...
Fingers crossed!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 07:33 AM
Hi Lindsey,
Sorry I didn't read that you wanted to use it as a default value.
To make this work, remove the last line gs.log(...
And replace it with:
dueDateGdt;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 09:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 09:46 AM
Sorry Lindsey, not having much luck here!
I've tested this and definitely got it this time...
You just need to add the below as a new line at the top of your script:
javascipt:
So it will look something like:
javascript:
// Get the datetime now
var nowGdt = new GlideDateTime();
...
Fingers crossed!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 09:59 AM
That worked! Thank you so much for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2014 10:58 AM
Hi Lindsey, feel free to mark correct and helpful responses on this thread