Announcements
No record found.
Hello,
I would like to set an email alert to go out when a Case is created outside of business hours.
Business hours have been defined in a Customer Service Calendar and a Holiday Schedule for this year. I would like to check against these calendars to confirm if the Case was created inside or outside the business hours so then I can then have my outside business hours alert.
What would be the best way to do this?
Many thanks,
Mike
Hi Mike,
A customer service schedule determines the business hours for each day in a week and also the weekly off. Customer Service uses these details for time tracking of service-level agreements (SLAs).
However, sla can’t send email alert when case is created out of business hours, it just can extend the countdown.
So you have to compare created on field value with business hours directly, the flow maybe one way, but it just can check specific date is a weekday by using the dayOfWeek function.
which returns a number – 0 is Sunday, 6 is Saturday, and anything in between is a weekday.
For example:
For time of the date field, it’s hard to compare,i have not found a way to compare time.
So you have to check created on field of the case manually to specify whether the case was created during or outside business hours.
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Thanks Leah,
What I was thinking is that when the case is created, a workflow / process was started which then checked the time the case was created and cross referenced that against the SLA which details the Business Hours. If the case creation date and time is outside of the Business Hours then it sends the email.
My reason for doing that cross reference is that I need to take into account public holidays as well as the normal working week.
Thanks for your example, your instructions are very clear and I can follow those but unfortunately it does not solve my problem.
Not sure if there is now a simple SDK/API call or not - there wasn't the last time we worked with Calendars and non-working time (we had to do an SLA date - but the opposite of what the SLA does - x time before a date taking into account the non-working) - ours was a custom Action (basically a plugin registered to an Action).
Accessing the Calendars is a bit of a pain - and the documentation was not very good. The details are stored in Calendar Rules in the Calendars and to access them needed to use ExpandCalendarRequest/ExpandCalendarResponse to convert the calendar rules to an array of available time blocks for the specified period (then check if the date-time is in an available block etc). docs.microsoft.com/.../microsoft.crm.sdk.messages.expandcalendarrequest
Couldn't find any thing quickly other than an old blog posts
www.inogic.com/.../
salimadamoncrm.com/.../
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 46 Super User 2026 Season 2
Travis South 45
Ayesha Wajahat 18