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.

How to add 5 Business days?

sailor_moon
Tera Contributor

How to add 5 business days using flow designer? It should auto populate the next contact date once I run test. Please help me. Thank you!

find_real_file.png

find_real_file.png

 

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage

Hello ,can you try this below script

var contactDate = new GlideDateTime(fd_data.trigger.current.your_last_contact_field_backend_name);
var days = 5;
//assuming there are 8 business hours
days = days*8;
var dur = new GlideDuration(60 * 60 * 1000 * days);
var schedule = new GlideSchedule('your_schedule_sys_id'); //put your schedule sys_id here which can be 9 to 6 or 8 to 5 schedule which can be found in cmn_schedule table
return schedule.add(contactDate, dur);

MARK MY ANSWER CORRECT IF IT HELPS YOU

View solution in original post

1 REPLY 1

Mohith Devatte
Tera Sage

Hello ,can you try this below script

var contactDate = new GlideDateTime(fd_data.trigger.current.your_last_contact_field_backend_name);
var days = 5;
//assuming there are 8 business hours
days = days*8;
var dur = new GlideDuration(60 * 60 * 1000 * days);
var schedule = new GlideSchedule('your_schedule_sys_id'); //put your schedule sys_id here which can be 9 to 6 or 8 to 5 schedule which can be found in cmn_schedule table
return schedule.add(contactDate, dur);

MARK MY ANSWER CORRECT IF IT HELPS YOU