Auto-Closure of Task considering Work Hours and Holidays in Dynamics 365


Auto-Closure of Task considering Work Hours and Holidays in Dynamics 365.

Recently we had a requirement to auto close the task after 2 days of due date passed. Here we had to consider work hours and holidays as well.

The good thing was that with SLA considering both work hours and holidays, we could implement this without writing a single piece of code.

Below are the steps to implement it –

Enable SLA for Task

Navigate to Settings à Service Management à Click on Service Level Agreement and create a new SLA against Task.

Create a new SLA record with following details.

Here we need to specify Business Hours in our SLA. For this, we will be creating a Customer Service Schedule record which observes the holiday.

So let us first define a new Holiday Schedule.

Navigate to Settings à Service Management and click on Holiday Schedule.

This holiday schedule will be used while defining Customer Service Schedule.

Create a holiday schedule record and add holiday records to it.

Here we have added a sample holiday of 2 days.

Now let us define the Business Hours.

Navigate to Settings à Service Management à Customer Service Schedule

Create a new schedule

Set Workdays as Mon – Friday and work hours as 8 – 5 P.M. and select our Holiday Schedule record created earlier.

Let us update our SLA record with these new customer service schedule.

Let us try creating a new SLA Item record. Here we will find that there is no KPI’s defined i.e. SLA KPI drop down doesn’t have any value.

Let us define an SLA KPI here.

For defining KPI we need to create a new relationship between Task and SLA KPI Instance (n-1 i.e. Many to 1).

Open the Task form for customization and add this new lookup SLA KPI Instance on the form.

Next, add a Quick View Form of SLA KPI entity in it.

Click on Edit to update the Resolve By SLA quick view form to add a new field Failure Time in it.

Add the Quick View Form to the Task form.

Back in our SLA item,

  • Select the new KPI created.
  • Specify Applicable as when status reason not equal to either completed or cancelled.
  • Failure after 18 hours i.e. 2 Days (as we specified 9 hours working in Customer Service Schedule)
  • Warning as 9 hours.

G

  • Activate and Set as Default.

Creating a task with Due Date will start the Timer for Resolve In.

In the task record created we have set the Due Date to 22nd Nov 8 A.M. and we can see the resolve by date to be 27th.

In our SLA we had set the Failure After as 18 hours, and the holiday was set on 23rd and 24th. And also 25th and 26th being Sat-Sun the Failure Time comes as 27th Monday, which is exactly what we want.

Another interesting way of implementing the same without using SLA.

https://community.dynamics.com/crm/b/hayersdynamicscrm/archive/2014/06/20/dynamics-crm-how-to-add-working-days-by-calculating-business-closure-and-weekends

Hope it helps..


Discover more from Nishant Rana's Weblog

Subscribe to get the latest posts sent to your email.

Unknown's avatar

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nishant Rana's Weblog

Subscribe now to keep reading and get access to the full archive.

Continue reading

Power Platform Puzzles

D365 CRM, Power Platform Tips &Tricks

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Microsoft Business Applications Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog - PPUG.ORG

AI - Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue

The Professional Paraphraser

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

Power Platform Learning

Your Go-To Resource for Power Apps, Power Automate & More

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.