infor.com
concierge
infor u
developer portal
Home
Groups
Process Automation (IPA) Community
TimeOut -> Only on business days.
Legacy Contributor
Does anyone have an example of the user action node only timing out on a business day?
Find more posts tagged with
Comments
JD Miller
A qualifying question I have, is are you attempting to make sure a 5 day timeout ends on a M-F? or are you attempting to Time out in 5 business days. (Values given are just examples)
Both would be done using the javascript editor set that variable based on the System day (not date) Sunday = 0 Saturday = 6. But the logic in the node would differ depending on the answer to the above question.
russel-cornelson
var currentDate = new Date();
var weekday = currentDate.getDay();
var TimeOutDays;
switch (weekday){
case 0:
TimeOutDays = 3; //mon,tues,wed
break;
case 1:
TimeOutDays = 3; //tues,wed,thur
break;
case 2:
TimeOutDays = 3 //wed,thurs/fri
break;
case 3:
TimeOutDays = 5; //thurs,fri,sat,sun,mon
break;
case 4:
TimeOutDays = 5; // fri,sat,sun,mon,tues
break;
case 5:
TimeOutDays = 5; //sat,sun,mon,tues,wed
break;
case 6:
TimeOutDays = 4; //sun,mon,tues,wed,
break;
default:
TimeOutDays = 3; //should never get used.
}
russel-cornelson
NOTE: You could likely write this is a bunch of different ways simply using math with dates if you know exactly what you are looking for. But the above example should get you going in the easiest fashion
Important Links
Community Hubs
Discussion Forums
Groups
Community News
Popular Tags
ION Connect
ION Workflow
ION API Gateway
Syteline Development
CPQ Discussion Ask a Colleague
Infor Data Fabric
Infor Document Management (IDM)
LN Development
API Usage
FAQs, How-To, and Best Practices