- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 03:31 PM
Hello,
I'm trying to set the default value of date field to 30 days from today by using javascript. Any ideas how the code will look like? Thanks for the help
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 06:20 PM
You should be able to put the following in the default value field on that field's dictionary record.
javascript:gs.daysAgo(-30);
GlideSystem Date and Time Functions - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 06:20 PM
You should be able to put the following in the default value field on that field's dictionary record.
javascript:gs.daysAgo(-30);
GlideSystem Date and Time Functions - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2014 09:05 AM
Thanks Brad! That works

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2014 06:32 AM
Hi Michael,
If that worked for you would you mind marking my answer correct? Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 11:50 PM
Thanks Brad,
Its working