Universal Resource Scheduling


URS is the scheduling engine in Microsoft Dynamics 365 Customer Engagement that allows you to enable scheduling for any entity, even custom entities. It’s used to find the best resource based on a set of different variables for example availability, skill set and location.

Enabling the entity for scheduling.

Navigate to Universal Resource Scheduling app – scroll down to Administration in the sitemap and this is where I find the Scheduling Setting and surprisingly enough choose Enable Resource Scheduling for Entities to proceed.


All entities enabled for scheduling need a Booking relationship and a Requirement relationship. These can be created directly in this stage by choosing Create new Relationship but in my opinion they never should be created here. Doing it here means they end up in the default solution and get the “new” prefix. This is not best practice. Don’t do it.


Don’t create a relationship this way

Instead go to web.powerapps.com to create these relationships in a solution with a publisher (and therefore prefix) of my choice. Vreate a 1:N relationship to the Bookable Resource Booking entity and one 1:N relationship to the Resource Requirement entity.


When I navigate back to the setup wizard I find my relationship as an option next to the create new relationship option. Okay, LET’S PUBLISH!



So by publishing we got the Book option in the command bar to appear on the Event entity. This is a good start but wouldn’t help  much to schedule it.

What happens if we choose Book is that a Resource Requirement is then created in the background and the Schedule Assistant would try to use the Resource Requirement to find the most suitable resource available for my Event. But the Resource Requirement would not contain any data from my Event entity and therefore not actually help me at all. So lets take a look at the Booking Setup Metadata and see what we can do to fix that.





The Booking Setup Metadata

After you press the Publish Customization button a pop-up window with the Booking Setup metadata appears. This record is divided in to three sections.

The first section is populated with the information we just added when enabling the entity for scheduling. The only field not populated is the Booking Status Field Logical Name. There is a great blog post by Dan Gittler that describes the functionality regarding this setting and what you can do with it here so there really is no point  me going further in to it.




Most the second section is kind of self-explanatory. Two of my favorite settings
Cancel bookings when moving : Selects whether, when moving open slots to the next day, to leave the old slots and change their status to “Cancel.” This makes a great impact to your statistics

Available Duration Minimum (%) : Select whether you want a resource to show up as a suggestion even though they are not available for the whole duration.




The last and third section is called Attribute Mapping and refers to what fields from the custom entity to map to the automatically created Resource Requirement. For example since we don’t have Longitude on the Event entity that could be mapped with the Resource Requirement entity, that mapping option is unavailable.




Using the Book button in the command bar on the Event form gives a slightly better result. The Schedule Assistant applies all mapped attributes as filters when searching for a resource.




The attribute mappings on the Booking Setup Metadata are few and static. Tto add more navigatie to the solution (use the classic interface, the new powerapp interface does not handle mappings yet) and add more mappings there. In this picture I’ve added mapping for Resource Type as an example.



In several cases this might be enough to get the right result of resources suggested by the Scheduling Assistant. In my case it will not be.

Refine your search

my event is either a seminar, a training or a product launch.




When you have an option set with two or three values  use the custom control framework option set to make it more user friendly.


To search for a trainer when the type is Training.


What is a resource?


All resources in URS have something called a Resource Type. trainers do not have access to Dynamics 365 CE so add them as resources of the type Contact.


Will it be enough to search for all resources of the type Contact? Will I not ever have other contact resources that are not trainers? I most likely will, so we use other filter options to narrow it down even more.
Ensure that all  Trainers have a Bookable Resource Category assn that relates to a Bookable Resource Category named “Trainer”.


What did you just call that entity?


These entity names are long and confusing and to make matters worse this particular entity are also called “Resource Role” in some site maps, sub grid areas and such. To make it a little less confusing.


Workflow

Check that the Event Type is Training (1) and if so then create a Resource Requirement (2).


populate the Resource Requirement with the following fields from Event:
  • Name
  • From date
  • To date
  • Event
  • Duration



Create a Requirement Resource Category (1) and add that to the Resource Requirement (2), and of course populate this with the Resource Category (3).

Be careful when you use records/lookups in workflows as they may cause deployment issues. Make sure you have a plan for a maintainable deploy process.

Save and activate the workflow.

Since we chose to trigger my workflow on creation of the Event the Resource Requirement will be created automatically. Navigate to the related view of Resource Requirement (1) and choose Book in the lower command bar (2).

The Schedule Assistant pop open in a new window and here you can now see that there is a filter for the Role/Category Trainer. Tadaaaa!

Comments

Popular posts from this blog

D365 F&O - Adding custom entities to Case Management

Microsoft Dynamics CRM Time zones

Dynamics 365 user/audit logs