Catalog Item with date based on Business Days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2023 07:24 AM
Hello! Currently we have a catalog item that has a field "decommission date" that needs to be auto-populated based on 5 business days from the day of submission. What would be the best way of accomplishing this?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2023 08:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2023 08:38 AM
Yes I have access to a schedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2023 08:47 AM
Let me give you a script.
var startDate = new GlideDateTime(new GlideDateTime().getDisplayValue());
var dur1 = new GlideDuration(60 * 60 * 24 * 1000 * 5);
var sch = new GlideSchedule();
var schedule='8f68e08ddb98534048a6e1aa4b9619eb';// Sys ID of "24*5" Schedule
sch.load(schedule); // 24*5 schedule
var d1 = sch.add(startDate, dur1);
gs.info( d1);
C |
If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions. |
Thanks and Regards,
Saurabh Gupta