Project: Changing Work Hours for a Work template’s Template Resource

Work Hours and Work templates, which are also known as Calendar Templates and Work Hours Templates, have have a logic of their own in both Project for the web and Dynamics 365 Project Service Automation. Back in the day of PSA V1 and V2, new Work templates needed to be created from scratch, if a change to the underlying work hours was needed. In PSA V3, things got a bit better and changes to Template Resources were honored. I have previously written about that on this blog post.

So what’s the catch when it comes to Project? I’ll challenge you to try the following out: Navigate to a Work template that has the Template Resource lookup populated. The resource in question must already have Work Hours set. Next, change the Work Hours of the resource in question and don’t touch the Work template. Create a new project and choose the Work template in question. Observe if changes to the Work Hours are reflected on Project Tasks (spoiler, they’re NOT reflected).

As the whole backbone of Work Hours in Project for the web is the good old Calendar entity, it’s a pretty safe bet to assume that Work Hours and Work templates behave much like they do in PSA V3. When I was recording my vlog about Work templates, I was pretty sure someone would pick the issue of changing Work Hours up. The grand prize goes to Matt Johnson. For those of you who don’t know Matt, he has been working with PSA since it was released in 2016. He’s a sharp guy with a ton of PSA experience. You can find Matt and pretty much the majority of the world’s top PSA experts on the Partner Yammer’s PSA community.

After all this background information, you’re probably eager to get to the actual content that will help you make your Project implementation around Work Hours and Work templates easier. For that, I’ve run through different scenarios in which I’ve edited the Work Hours of a Work template’s Template Resource, to see how those changes impact both existing and new projects. The different scenarios are below, however in short my message is: Make sure to always clear the Template Resource lookup, save the template and reassign the resource to the lookup, after making changes to the Template Resource’s work hours.

On to the different scenarios.

Change the Work Hours of a Work template’s Template Resource, without clearing the Template Resource lookup

1st scenario
Change the WHs of a Work template’s Template Resource -> add a new task on an existing project that uses the previously mentioned Work template.

Result
Changes to WHs are not honored.

2nd scenario
Change the WHs of a Work template’s Template Resource -> change the Work template on an existing project to another template and then back to the original template ->  add a new task on that project.

Result
Changes to WHs are not honored.

3rd scenario
Change the WHs of a Work template’s Template Resource -> add a new project that uses the previously mentioned Work template -> add a new task.

Result
Changes to WHs are not honored.

Change the Work Hours of a Work template’s Template Resource and clear the Template Resource lookup

1st scenario
Change the WHs of a Work template’s Template Resource -> clear the template of the Template Resource and save -> add the original Template Resource back and save -> add a new task on an existing project that uses previously mentioned Work template.

Result
Changes to WHs are not honored.

2nd scenario
Change the WHs of a Work template’s Template Resource -> clear the template of a Template Resource and save -> add the original Template Resource back and save -> change the Work template on an existing project to another template and then back to the original template ->  add a new task on that project.

Result
Changes to WHs are honored.

3rd scenario
Change the WHs of a Work template’s Template Resource -> clear the template of a Template Resource and save -> add the original Template Resource back and save -> add a new project that uses the previously mentioned Work template -> add a new task.

Result
Changes to WHs are honored.

And that’s it, folks! I hope this short blog post helps you avoid the pitfalls so many of us have spent countless of hours on, when changing Work Hours and Work templates in PSA. All that you need to remember is to clear the Template Resource lookup and then reassign a resource, after you’ve changed a Template Resource’s Work Hours.

Disclaimer:
All my blog posts reflect my personal opinions and findings unless otherwise stated.

2 thoughts on “Project: Changing Work Hours for a Work template’s Template Resource”

  1. Antii, you’ll make me blush 😉

    I like to create a generic Resource (that way you don’t need to link it to a Contact/Account/User) and name it as the work hours I’m going to set up for it. e.g. Mon-Fri 9am-5pm or Tue-Thurs 6am-3pm etc. Then I set it’s work hours and use that as the Template Resource on the Calendar Template. It keeps everything neat a tidy. You can also set these Resources to not be schedulable or searchable on the Schedule Board (or you can in PSA v3 anyway so probably just needs the fields showing on the Resource form in the Project Model Driven App). This way it’s less likely that someone will mess around with the Work Hours Template and lead to potential confusion like they might if you base it on a normal User Resource.

  2. Hi. I need to add the work hour template to all resources by programmatically. Could you please help me which request we can use to update all resources.

Comments are closed.