Hello Community,
I'm currently stuck on how the data model for SLAs and their Business Hours configuration works.
Requirement:
We have contracts where there are two different response times depending on when exactly the incident was reported, for example:
From 9am-5pm response time for High priority is 1 hour.
Outside of that (="24/7 minus 9-5") the response time for High priority is 2 hours.
Situation:
To accomplish that, I was planning to add a secondary SLA field to the entitlement table. We're already assigning the SLA to the incident through a custom plugin, so I thought I'd just build on that.
Trying to figure out the data model behind the SLA and its Business Hours configuration turns out to be a nightmare, though. So far I am able to do the following:
Retrieve the Business Hours from calendar table, using a link to also retrieve the attached calendarrule records (as this entity does not support RetrieveMultiple for some reason).
Identify the UI configuration in that record - there's
* "pattern" attribute that contains interval, frequency and weekdays, as a CSV string.
* "offset" which seems to be the offset from 0am, if the Business Hours start at 1:30am it's going to be "90"
* "duration" which seems to be the duration once offset is reached - if Business Hours started at 1:30am and endet at 2:30am, it's going to be "60"
While doing it like that seems like an odd way to do this, I thought I had finally found out how to achieve my goal - but for some reason when you look at a calendar record of type 1 (the type used for SLAs), there is NEVER an offset or duration set.
The URL used for the classic UI configuration is https://*.crmX.dynamics.com/SM/workplans/Dialogs/TimeSheet.aspx?id=%7<id>%7d&mode=Edit&resourceid=%7b<id>%7d&oType=8&calendarid=%7b<id>%7d&calendarType=1 - but there's no table called TimeSheet or anything similar to it.
Anyone have any clue as to where this information is stored then?