- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 01:46 AM - edited 02-27-2023 03:23 AM
I want to set due date in flow designer where i just need to minus 14 days from current date and return in due date for flow designer .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 04:17 AM
var gdtDateTime = new GlideDateTime();
var grSchedule = new GlideRecord('cmn_schedule');
grSchedule.addQuery('sys_id', '377f9850dbe07b803b841ded0b961950');
grSchedule.query();
if (grSchedule.next()) {
var counter = 14;
var grSched = new GlideSchedule(grSchedule.sys_id);
for (i = 0; i < counter;) {
gdtDateTime.addDaysLocalTime(-1);
if (grSched.isInSchedule(gdtDateTime)) {
i++;
}
}
}
var todayDateEsd = gdtDateTime;
var gettingDate = todayDateEsd.getDate();
return gettingDate;
Make sure you create a schedule in 'cmn_schedule' table and have a schedule entries .
Refer to the screenshots.
Please mark as correct/helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 07:45 AM
Hey @Naga Ravindra R if i have to use the same script but ADD 17 DAYS to a variable to display the due date how will it be done, can you please show it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 08:13 AM
Hello @suprajam ,
would you mind creating a new community question and tag me?
I can reply asap.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 10:42 PM
sure will do it