82
Views
4
Comments
How to get the next working days based on Site Property
Question


Hi Guys,

I am working on some PoC mobile app to know employees are working in the office for certain days.

I wanted to build a recurring function that e.g. I'll be working in the office every Tuesday that are based on the SiteProperty = 2 months so multiple by 8 weeks.. so it will save into the DB the next 8 weeks of every Tuesday.

Now, how to get the future every Tuesday for 8 weeks using any built in function or maybe "AddDays" in OutSystems please?

Appreciate your help and Thanks in advance! :)



Rank: #517

TheGame wrote:


Hi Guys,

I am working on some PoC mobile app to know employees are working in the office for certain days.

I wanted to build a recurring function that e.g. I'll be working in the office every Tuesday that are based on the SiteProperty = 2 months so multiple by 8 weeks.. so it will save into the DB the next 8 weeks of every Tuesday.

Now, how to get the future every Tuesday for 8 weeks using any built in function or maybe "AddDays" in OutSystems please?

Appreciate your help and Thanks in advance! :)



Hi,

I already tried to get Monday before, the function should like this:

AddDays(In_InputDate, 1 - DayOfWeek(In_InputDate))

Based on the input date, I get the Monday of that week. In your case, just plus 1 to get Tuesday of the week

Hope this help

mvp_badge
MVP
Rank: #5

Hello The Game, 

Yes, you will have to do a looping. 

Don't forget that in a real application (but your poc audience may ask about it), ypu will have to take into consideration holidays, vacations, etc. 

Cheers