Service Activities and capacity scheduling in Dynamics CRM

By | June 22, 2013

When working with service activities, we can use out of the box scheduling feature which allows us to choose appointment times based on the resource availability. Resource availability, whether it’s a CRM user resource or a CRM facility resource, relies on the capacity calculations. Many times, we’ll have default capacity for our resources (which is 1), but, in some cases, we may end up configuring a facility with a greater capacity.

As it turned out, that’s where things get a little weird.

Consider the following test:

  • Create a service that only needs 1 resource from any site
  • Create a site
  • Create a facility and make sure to update it’s work hours so that it has, for instance, 100 capacity
  • Set facility’s site lookup
  • Add that facility as a resource to the service

Once it is done, you are supposed to be able to create 100 service appointments for any particular time (which falls into your facility work hours of cause) if you choose the service, site, and facility you just created. That’s because you have a facility with 100 capacity.

The thing is, it does not seem to work as expected. Not all the times, at least.

If you use “Schedule” screen in CRM, then everything will be fine. CRM will correctly calculate remaining capacity, so you’ll be able to create 100 appointments.

However, if you don’t go to the “scheduling” screen and create your service appointment by manually assigning all the lookups, CRM will completely book off your facility for the selected time once that appointment is created. Even if you only create 1 appointment.

A bit of digging in Fillder shows that there is an extra parameter which CRM passes to the server when you use “schedule” button. Do you want to guess parameter name?

It’s called “effort”.

Apparently, when that parameter is missing, CRM decides that your facility has been booked off completely.

I’m not quite sure how to fix it in CRM UI – in my case I was trying to make CRM calculate capacities properly when using SDK, and I was having exactly the same problem. As it turned out, all I had to do (again, in my C# app) is to add “effort” attribute to the resource activity party when creating new service appointment:

resourceParty.Attributes[“effort”] = 1.0;

And that seems to have fixed the problem.

I’ve posted this question to the MS CRM forums, so, if you are interested, take a look there:

http://social.microsoft.com/Forums/en-US/edbd35a6-700d-4583-a0d4-7273c88ab6ad/service-activities-and-resource-capacity

Leave a Reply

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