How to set due date in flow designer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2023 01:02 PM
Could you please help me to set 10 days from now on due date field using flow designer.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 09:10 AM
Hi, did any of you find a solution to apply schedule to due date calculation on the base of delivery time from flow (not workflow), that is set by duration of flow stages) ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 10:17 AM - edited 08-08-2024 10:18 AM
In the Flow we set the Due date value with a script and it works for us. Hope this helps!
var startDate = new GlideDateTime(); //your start date goes here or leave empty if you want to use current date/time
//var tZone = 'US/Eastern'; //optional - time zone will more than likely already be in your schedule.
var days = 2;
var dur = new GlideDuration(60 * 60 * 9 * 1000 * days); //60 seconds in a min, 60 min in an hour, 9 hours in a day(based on our shedule)
var schedule = new GlideSchedule('<sys_id>'); //pass the sys_id of your schedule and optional second parameter can be time zone
var dueDate = schedule.add(startDate, dur);
gs.info("Due date " + dueDate);
return dueDate