Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2021 01:58 AM
client script to add 1 year to current date i.e., System created date.
Solved! Go to Solution.
Labels:
- Labels:
-
Knowledge Management
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2021 02:09 AM
Hi,
like this in the onLoad or onChange client script
var todayDate = new Date(new Date().setFullYear(new Date().getFullYear() + 1)); // Now
g_form.setValue('valid_to', todayDate.toISOString().slice(0,10));
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2021 02:09 AM
Hi,
like this in the onLoad or onChange client script
var todayDate = new Date(new Date().setFullYear(new Date().getFullYear() + 1)); // Now
g_form.setValue('valid_to', todayDate.toISOString().slice(0,10));
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader