Business Calendars & Tasks. Restrict to following working week

Hi,

I've been looking into the business calendars in Administration > System > Timings and set up a calendar around our companies workdays (Normal 9-5, 5 day week)

In some of our workflows we have tasks created for our users to follow up with customers in 2 days. If this point in the workflow is reached on a friday we expected the task to become overdue on the Tuesday. However, it becomes overdue on the Sunday when no staff are in the office.

As we've got escalation rules setup for overdue tasks the system sends out emails every few hours to inform the user that their task is overdue. When really it's not as it doesn't need actioning till Tuesday.

How do we make these tasks follow the business calendar we've created?

Thanks,

Will

  • 0

    The only way that I have found to do this in the past is to write a SQL UDF that will return a value to the view that the escalation rules uses. The UDF can reference the business hours that are defined in CRM and then work out the timings. If I recall I had to do one that was equivalent to a datediff function and one as a dateadd function.

  • 0

    You don't need to express that rule as a user defined function in SQL.

    Considering using DATEPART and suppressing escalation on the weekend.

    select * from communication

    where comm_status = 'Pending' and

    comm_datetime

    and DATEPART(WEEKDAY,comm_datetime) not in (1,6)

  • 0

    Will

    The escalation rule will have a SQL Clause that will look like

    where comm_status = 'Pending' and

    comm_datetime

    You just need to add the additional clause to exclude triggering at the weekend.

    and DATEPART(WEEKDAY,#T) not in (1,6)

  • 0

    Hi Jeff,

    Thanks for the info. Where does this need to be applied? In the escalations rules Trigger Clause or somewhere else?

    Thanks!

  • 0

    Ah well, now I go back an actually read the question properly...

  • 0

    As much as I don't like disagreeing with you Jeff, I'm not sure that solves the problem. Although that would stop triggering the rule over the weekend they would all just trigger first thing on the Monday morning rather than on the Tuesday as required. The requirement is to effectively add two days to the trigger time when it spans over a weekend.

  • 0

    Perkins you're right it doesn't solve the problem. As our tasks are created via the workflow and not manually by users we can't use escalation rules in the workflow as tasks aren't able to be created in that particular rule type.

    We use something called Iman, which has Sage CRM integration and the ability to perform lookups, writebacks & updates etc, very useful software. So I'm thinking that we can has a process running in Iman that would lookup any tasks who's due dates fall on a weekend and then to update the due date to either the Monday or if possible the day it's actually due on. I've a feeling that the later may not be possible but worth a try.

    is there any future plans to have expansion on the business calendars so that there's an option to only have tasks work on weekdays and ignore weekends? I know that it's used for the total working time on cases, opportunities and leads etc but some sort of setting for tasks would be really useful I think.

  • 0

    Just to give a little further detail on what we've setup so far in terms of overdue tasks.

    This is the view that the escalation rule uses

    This is the escalation rule that sends out email every 2 hours to users when a task is overdue.

    Trigger SQL clause; comm_DateTime