Working days filter

Hello Team, Does anybody know how to do filters by working days in a business process? I have a case where I need to check if a case stays in a status for more than 2 working days.

Thanks,

 

Like 0

Like

7 comments
Best reply

Hello Frederico,
You can try with this type of code in the business process:

[#dateCase#].DayOfWeek.ToString()=="Saturday"?[#dateCase#].AddDays(2):[#dateCase#]

and

[#dateCase#].DayOfWeek.ToString()=="Sunday"?[#dateCase#].AddDays(1):[#dateCase#]

Hello Frederico,
You can try with this type of code in the business process:

[#dateCase#].DayOfWeek.ToString()=="Saturday"?[#dateCase#].AddDays(2):[#dateCase#]

and

[#dateCase#].DayOfWeek.ToString()=="Sunday"?[#dateCase#].AddDays(1):[#dateCase#]

LÉZORAY Nicolas,

Hi Nicolas, this apply only in case they dont work on saturday or sundays. The SLA applies for holidays or others non working days. I want to use that as well because are not working days.

You can add a boolean var isHollidays set by default to false, in the business process, then add a source code with the non working days in an array :

ObjectList<string> Hollidays = ObjectList.Create(
	"0101",
	"2512" 
);
 
var dateCase= Get<string>("dateCase");
 
if(Hollidays.Contains(dateCase)) {
	Set<bool>("isHollidays", true);
}
 
return true;

So next step is a formula which will check the isHolliday value, you can add one day if it is an holliday day :

[#isHollidays#]?[#dateCase#].AddDays(1):[#dateCase#]

I hope this helps you !

 

LÉZORAY Nicolas,

Thank Nicolas, I was hoping we could use the OTB functionality already implemented in the case SLA.

The out of the box logic for resolution dates for cases based on SLA starts with the CaseTermCalculateEntryPoint source code schema. It uses the CalendarUtilities source code schema, which is where the real work with adding days based on a selected calendar is done. You could look at those to see if you could reuse for your needs.

Ryan

Ryan Farley,

Thanks Ryan, I look that and seams is always on future dates, from start date + in my case is from today - (days) I guess is a good idea to have as date filters (workin days).

Working days would be a great addition to OOTB functionality. ! 

Like also the possibility to add Fiscal Year capabilities (which then has fiscal quarters and months aligned too). 
Freedom UI Dashboards/Metrics are great, but timelines are only based on calendar year and not fiscal year, which is really, really not practical. 

Knowing Creatio also have their fiscal not aligned with calendar year, surprised this has not been implemented OOTB for a long time already...

Show all comments