Question

Use Order Date to generate Invoice

Hi Everyone,

 

We have 2 different types of rates for Customers. One is when the Order date is within Weekdays (Monday-Friday) and the other is for Weekends (Sat-Sun). We have an Order date/time field in our orders. Now is it possible to write a formula that finds out that using that date/time field to determine if the day is Weekday, then it uses the Weekday rate in the business process otherwise it uses the weekend rate?

 

I am looking into DayOfWeek() function but am unsure how to use it in the process. Also, this page is created in Freedom UI if that makes any difference. Thanks in advance!

Like 1

Like

4 comments

Bump!

Any help with writing this Formula? I need to write a formula that differentiates my Order Pickup time (Date/Time field) from Weekdays and weekends

Hi Hassan, 



You need to use the DayOfWeek property of the DayTime class in the formula. 

 

Create a new boolean parameter called IsWeekday 

Create a new formula element in your business process and populate it with the following : 



"YourDateTimeField".DayOfWeek > 0 && <=5 

 

Then, based on the value of your IsWeekday parameter you can proceed with calculating the rate for the order. 

 

Best regards,

Yuri.

Yurii Sokil,

Thank you, Understood

 

Show all comments