- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 04:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 05:51 AM
Hi @nandhini muthu ,
You can use calculated filed option like below.
Code:
var gdt = new GlideDateTime();
gdt.addDaysUTC(7);
gdt.getDate();
return gdt; // return the calculated value
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 07:03 AM
Thanks for the reply to everyone
But ,I need this .Date field should be auto populate with addition of 7 days from current date and exclusive of holidays/weekends .So I have created schedules and used in the script include and Onload client script .But getting 'javascript browser console error ".Please give your inputs
Please find the code below:
Please find the code of script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 11:10 PM
Hi @nandhini muthu ,
Update the script include code with below.
var days = 7;
var opened = new GlideDateTime();
var duration = new GlideDuration(60*60*24*1000*days);
var schedule = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828'); // Use the Existing 8-5 weekday schedules
var updatedDays = schedule.add(opened, duration);
return updatedDays ;
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:31 AM - edited ‎01-29-2025 03:33 AM
I have tried as you mentioned,but still getting same error
script include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:32 AM
Please help me on this.