Bulk Update Work Hours – XRMToolBox Plugin

Bulk Update Work Hours

An XRMToolBox plugin to bulk update Resource work hours on the schedule board.

Download Here

How to set Working Hours

Retrieving Bookable Resources

You can set custom FetchXML to fetch the Bookable Reosurces in your organisation. When constructing your XML, ensure that the attributes ‘name’, ‘bookableresourceid’ and ‘calendarid’ are included in the fetch as they are needed when performing the updating of work hours.

Once you have selected the resource work hours you want to update, you need to copy any of the scenario’s below and press the ‘Set Work Hours’ button.


Setting work hours with no end date with the same working days and hours


Setting work hours between two specific dates with the same working days and hours


Setting work hours needed with no end date and different hours by day


Setting work hours between two dates with different hours by day


Setting Work Hours but for every other week

The ‘Every X Week(s)’ option determines if you want to set work hours for every other week.

E.g. If set the option to 1, then working hours will be created for the first week but miss out the second week after, but will be created for the 3rd week and so on.

If the option is set to 2, then working hours will be created for the first week but miss out the second and third week after, but will be created for the fourth week and so on.

This option works with all scenarios.


Calendar Types

There are three different types of calendars:

  • Working
    • Select this calendar type if you want to set the working hours of a resource
  • Non Working
    • Select this calendar type if you want to set the hours where the resource will not be working
  • Time Off
    • Select this calendar type if you want to set holiday for a resource

Capacity

Capacity is used to determine how many services this resource can perform at one time. This is only available for the ‘Working’ calendar type.


Time Zone

Select the Time Zone you want the Work Hours to be based on.


How to clear Working Hours

Once you have selected the resource work hours you want to clear, you need to copy the scenario below and press the ‘Clear Work Hours’ button.

Clearing Work Hours between two dates

Clearing specific Work Hours between two dates is more difficult to achieve than it first appears. Work Hours created in the system are referenced by a starting point, if you need to clear work hours between a specific date then you need to clear the first work hour to then clear the rest of the work hours. Let me explain.

E.g. If you create work hours between:

  • Jan 1st 2020 @ 09:00 & Jan 5th 2020 @ 17:00

To remove these work hours you just need to set the Start Date to 01 January 2020 09:00 and then End Date can be 02 January 2020 09:00 and this will remove all the work hours between 1st – 5th Jan regardless if you wanted to remove only the 1st – 2nd Jan. This is because all the work hours are related to the first occurrence of the work hour. (Confusing I know)


Clearing all Work Hours

To clear all work hours from a resource, you need to select the ‘No Start Date’ and ‘No End Date’. This will get all work hours and clear them.

Note… The ‘No Start Date’ option is only used for clearing work hours and not for setting work hours. It will also ignore the Start Date selected on screen.

19 thoughts on “Bulk Update Work Hours – XRMToolBox Plugin

  1. Hi Thomas,
    Good work with this tool, it would be nice if you could also display for each bookable resource what their current work hours are so that it is easy to identify where you have a problem that needs updating.
    Thanks
    Rob

    1. Hi Rob,

      Thanks for the feedback, I appreciate it!

      It may be that resources may have different hours to each other. But I understand that if all your resources all have the same work hours that this could be useful. Ill take your comments into account though.

  2. Hello Thomas,

    I am in Mountain Time (MT) (GMT-7), currently GMT-6 because of daylight savings. My team is in Eastern Time (ET) (GMT-5), currently GMT-4 because of daylight savings.

    When I bulk update working hours, I enter start time 1 a.m. in the bulk edit tool and see 1 a.m. start time on the calendar. The team sees this as start time 7 a.m. I don’t understand this and hope you can help me.

      1. I have updated the tool now so the user can manually select the timezone directly in the tool itself, rather than the tool getting the timezone settings from the user record.

  3. Hey Tom,
    I need to convert the weekly hours of all users into another entity to chart against booking hours so I can chart utilisation.
    eg. if a resource is set for 8 hours a week for 5 days, the total will be 40
    Is there a way to access this data to convert into totals?

    1. Hi Dave,

      You can retrieve the work hours using this query in this blog post – https://www.cloudfronts.com/work-hours-in-crm/

      The duration field would be the the total minutes for the day.

      However getting the number of days would be a little be trickier as its located in the field ‘pattern’ which is a string file and kind of looks like this -> “FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR”. You would probably need to somehow get the string and determine how many days there are. Maybe counting the number of commas in the string? 4 commas = 5 days?

      You can see the example of what fields are available here -> https://www.daymandynamics.com/bulk-update-user-work-hours-for-the-schedule-board/

  4. Tom,
    Thanks for building this. I noticed that when updating a schedule it ends the ‘recurring’ schedule and replaces it with individual day schedules. Is there a way to update the existing recurring schedule?

    1. Hi James,

      When building this tool I couldn’t find a way to create Recurring schedules or update them. The only way I was able to do it was to create a single day schedule for each day.

      I wont be changing the way it works unfortunatly 🙁

  5. Hi Thomas,
    Thanks for building this very useful tool.
    In my project I need to configure some bookable resource where calendar is “24×7 support” (so all days are working days and there are not non-working hours).
    How I can set this inside your tool?
    Thanks in advance

  6. We need to update Bookable reosurce work hours based on some criteria but by using this tool we can only update all resources. It would be better if you can provide conditions to get selected resources.

  7. Hey Thomas,

    Great tool, is there a way to list the Work Hours for each resource and then select which ones you can delete
    I bulk created a bunch of Time off Requests via Synapse and had the wrong endtime due to the UTC factor.
    I need to delete the Time Off Requests and then delete the related Work Hour entries
    cheers!

    1. Hi David, I dont plan to update this tool at the moment but I will take your feedback on board. Thanks!

  8. Hey there! I am trying to clear all work hours and reset again but I keep getting this error “The Start Time should not be greater than the End Time” even if I choose No Start Date and No End Date. Am I doing something wrong?

  9. Hi Thomas – I would like to create the all-day working hours with all-day occurrence for each resource as below setting:

    All Day enabled = True
    Capacity = 1
    Start Date = current date
    End Date = Start Date + 5 years (per this link https://learn.microsoft.com/en-us/dynamics365/field-service/field-service-work-hours-calendar-api#all-day-occurrence the maximum duration for an all-day occurrence is five years)

    Per the below MS link, it could be done by the supported APIs: https://learn.microsoft.com/en-us/dynamics365/field-service/field-service-work-hours-calendar-api#create-all-day-working-hours

    How could I set the same with your tool? Thank you in advance!

Leave a Reply to sravan Cancel reply

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