Skip weekends Business day tasks NetSuite

梦想的初衷 提交于 2019-12-10 12:09:06

问题


Using NetSuite, I am trying to automate the creation of monthly tasks. These tasks will fall on the last day of the month, a day before, and 1,2,3,4,5 days after the last day of the month. But, the tasks can't be due on a weekend, only business days. So if the day falls on a sat or sun the dates have to move up. How can I use my custom record to calculate the next months task dates skipping weekends? Here is a screenshot of the record - see that 10/4 and 10/5 fall on saturday and sunday, how can I have it skip sat and sunday? I used the sql function option to generate the dates and days of the week.


回答1:


I tested the following formula. Replace custbody_date with your field name. This formula should be set in your 'next month' column.

CASE WHEN INSTR(to_char({custbody_date}, 'DAY'),'SATURDAY') != 0 
THEN {custbody_date}+2 
WHEN INSTR(to_char({custbody_date}, 'DAY'),'SUNDAY') != 0 
THEN {custbody_date}+1 ELSE {custbody_date} 
END

This should also give you an idea to set the value for 'Next Month Day' (skipping saturday and sunday).



来源:https://stackoverflow.com/questions/25327342/skip-weekends-business-day-tasks-netsuite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!