Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

flow designer due date

suprajam
Tera Contributor

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 .

1 ACCEPTED SOLUTION

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.

View solution in original post

12 REPLIES 12

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.

Naga Ravindra R
Kilo Sage

Hello @suprajam ,

 

would you mind creating a new community question and tag me?
I can reply asap.

 

Thanks!

sure will do it