Tip #1038: Keep frequent notifications to the business hours

Nagging is a very effective way to get urgent things done. For example, if signature is required, keep sending email reminders every hour until it’s acquired.

One of the customers successfully mastered the technique of a recurring self-calling workflow and has been successfully firing emails left and right reminding good people of the outstanding work to be done. The challenge, as it turned out, was dealing with nights and weekends. If a task cropped up on Friday at 4:59PM, for example, by Monday the inbox would have had 64 identical emails. In other words, the workflow should send emails hourly until a certain condition is met (the proverbial signature is acquired) but only during the business hours.

There were number of suggestions from my good community friends, all effectively suggesting somehow checking calendar in a custom workflow activity. Which meant dealing with calendar and calendarrules (shudder). I even got some sample code that allows counting business hours.

Then, of course, none other than Joel has appeared in his shiny Dynamics armor.

What about leveraging SLA? Business hours can be associated with SLA. Could that be used to send your reminders but not do it in business hours?

SLAs do exactly that: they keep the clock ticking, can have actions associated with the failure and success, and they can observe business hours! The only challenge is making the process recurring. SLAs are smart, as it turned out. If you have a field that denotes the starting point for your KPI, and that field is reset, the KPI clock is reset too, making the process recurrent!

The process in a nutshell:

  1. Enable target entity for SLAs, if it’s not already
  2. Create Start Timer On datetime field (needs to be updateable, e.g. createdon won’t do a good job)
  3. Create 1:N relationship with SLA KPI Instance entity – that will allow keep the timers and conditions going
  4. Create a field that can record the success, e.g. Signature acquired (boolean)
  5. Create business hours calendar and SLA for your process observing that calendar. Add details along these lines:
    • Warning on 30 minutes: send email
    • Failure at one hour. Action should include setting the Start Timer On field to the execution time of the process (now, that is). That will reset the SLA countdown – that’s the trick!
  6. Optionally add timer control, do the other good stuff… This article is a good start. Activate the SLA.
  7. Create a workflow to apply that SLA, e.g. changing the status reason to Signature required or similar. In the workflow set SLA and Start Time On fields on the record. The system will take care of the rest.

And now set the calendar to weekends only – that will show them how to leave unfinished urgent tasks on Friday night!


Leave a Reply

Your email address will not be published. Required fields are marked *