I have commonly used the schedule board with Dynamics 365 Field Service or Project Service to schedule work orders or project tasks. But recently I’ve had a couple of requirements to schedule custom entities. This is possible using Universal Resource Scheduling. (URS) In this post I’ll explain my initial experiments with URS, if you are considering making use of URS then hopefully the information here may be of use.
As already mentioned URS is the scheduling engine used by Project Service and Field Service, it shares many concepts such as organizational units, roles, skills and resources. Because of this I won’t cover any of those in detail here! My focus will be how to create a custom entity that can be scheduled.
I started my testing with Universal Resource Scheduling by looking at this link. (You might find it useful!)
In my testing I wanted to create a custom entity that could be scheduled, that involved creating multiple fields on the entity that would help dictate the scheduling logic. I then made the entity available for scheduling. And finally, I customized the resource requirements form, bookable resource booking form and a few other things. In this post I will cover details for each of these in turn….
I am making an assumption in this post that the reading has a basic grasp of making customizations within PowerApps. (Sorry!)
Custom Entity and Additional Fields
I started off by creating a custom entity and adding a number of fields. You can see my simple entity below.
I have shown my form displayed using the newer version of the form editor in wed.powerapps.com. But I did find I “switched to classic” occasionally when adding my fields! This means the screen shots below may be a mixture of representations from the new and old UIs.
I guess I should point out that adding any of the additional custom fields is optional. You could simple “chuck” your custom entity into a resource requirement and enter any scheduling information there. But I would suggest passing in durations, dates and locations may help the process be much more polished.
On my entity I’ve added several fields specific to Universal Resource Scheduling. I will describe each of these below and expand on their use later in this post;
Neil’s Start Date & Neil’s End Date
The start and end date fields are simply the dates that I wish to use for scheduling this entity. (Or at least the date range I will use to try to find a suitable bookable resource from my resource request!)
Later in this post I will show were we define which date fields to use for scheduling. Because my entity is completely new I had to create all the required fields. Depending on your requirements you maty find some existing fields that can be used for these purposes!
Also notice that I opted for a date time field. I could have opted for simply a date field if I wanted to use these dates as a range to search for potential appointment slots. (As in that scenario entering the time might be unnecessary!)
Additionally, I created a duration field. This is optional but might be useful if you wanted to search for a free two-hour timeslot within a start / end date range.
Notice that the duration field is a whole number field with a format of duration.
The use of territories is options, but you might find it useful to filter resources / “jobs” based on territory. Say you have a team that works the north of the country and one that works in the south. You’d want to be able to dispatch the correct people to these jobs.
My territory field is simply a lookup to the out of the box territory entity.
Neil’s Lat & Neil’s Long
Again, defining lat / long fields is optional. These fields can be used to display locations of “jobs” on the schedule board and calculate (estimate) travel time between jobs etc.
Obviously, you’ll need to consider how to obtain this data! For example, assuming your custom entity is linked to a contact or account you may be able tot extract the information from them. In my “crude” example I simply showed the fields on the form and manually entered the lat / long coordinates!
I did find the data type / formatting for these fields needed to be very specific to ensure it would be available for use later. The data type for my coordinates is a floating point number. Additionally, it needs to have a precision of 5 decimal places, a minimum possible value of -90 and maximum of 90.
Neil’s Work Location
Again, work location is optional but one that may have a significant impact on how your entity is scheduled! This is an optionset that provides me with three possible options.
I will explain where this is used later but here I will describe the meaning of each option.
Onsite – Meaning the work will be conducted onsite. (aka, at the lat / long coordinates that you can optionally define.)
Facility – Meaning the work will be conducted at a facility.
Location Agnostic – Meaning we don’t care about the location and this “job” will not need to show on a map. Unless you need to represent “jobs” on a map this might be the most likely option you will select.
You might be new to the concept of facility scheduling. (Details can be found at the link given below.) The concept here is we would schedule multiple “jobs” to be completed at a given location. Example might include, bookings for cars to be serviced or patients at a doctor’s surgery etc. The work will be conducted at a location and that location wil, have a capacity. Meaning all the work is scheduled at the same facility until a capacity is reached.
My option set is defined as a global option set making use of an existing out of the box set called “Work Location”.
Enable Custom Entity for Scheduling
Ok, so we have created a custom entity and created whatever fields are required to aid scheduling. Now we need to enable the entity for scheduling.
We do this in the administration option in the resource scheduling app.
So open the “Resource Scheduling” App, navigate to settings and then select the administration option. Here you will find the option “Enable Resource Scheduling for Entities”.
Within the enable resource scheduling for entities option you’ll need to first enable your entity for scheduling. You can see below that you will select your entioty and then pick the relationships to be used to link to bookings and requirements. Assuming you are creating a new custom entity then you will probably not have any existing relationships to these entities. Therefore, you will select the “create new relationship” option in both cases.
Next you will click the “Publish Customization” button, this will enable your entity for scheduling.
Your entity is now enabled to scheduling but you may need to edit the metadata to refine how the scheduling will behave.
Below you can see that my custom entity is now listed in the enabled entities. Double clicking on it will allow you to set / edit the meta data.
Below you can see the metadata I defined for my custom entity. There are quite a few fields! (But not all are mandatory.) Also, as you will see later in this post, scrolling down the screen will allow me to link my custom fields to the scheduling logic.
There are quite a few possible fields that can be maintained in the metadata. Unfortunately, I found Microsoft’s documentation a little “short” in this area! You can see below that it is suggest you review the tooltips of each field to understand its meaning. This advise isn’t as bad as it sounds as you can gain quite a bit of information by doing this. Additionally I found it useful to look at the out of the box metadata settings for projects and work orders. As that might help you gain further insight.
Notice above that the note does mention the booking status field and the mappings. I didn’t create a custom status field, but I did set some mappings between my custom entity and the booking. I will mention that later in this post.
I didn’t test out every combinations of settings for the metadata, but as the documentation is limited I will reference a few that I did set below;
It is possible to define default status fields for your bookings and requirements. Most of these should hopefully be self-explanatory. For example, when a booking or requirement is cancelled what status should it be assigned. Commonly you might be selecting out of the box status values but this feature does give you the ability to define custom status defaulting if required.
Resource Availability Retrieval Limit
If you have a limited number of resources, then maybe setting this option is required! But if you have large numbers of resources you might want to limit the number of suggestions offered to your dispatcher on the schedule assistant. Say you have 1000 engineers; would you really want the dispatchers to have to pick from possibly hundreds of available resources? Limiting the selection might help make their life a little easier!
Notice below that I have hovered over the field label, the resulting tooltip (in this case) is quite useful!
Disable Requirement Auto Creation for Bookings
The default for this option is “no”. And that may typically what you’d require but in my particular use case I did alter this setting.
Typically, you will create a resource requirement from your custom entity and then book this later. Either on the schedule board or by using the scheduling assistant. It is however also possible to simply create a booking directly from your entity. If you already know the required time / duration and that a resource is available why not go straight to the booking stage?
Doing this (with the default of no) would automatically create a corresponding resource requirement. In many circumstances I can see that this will be preferable as you’d always have a requirement and booking for each job regardless of the sequence of events.
However in my use case I always wanted to directly book the “job”. So, I didn’t need (or want) a requirement record. This option allowed me to achieve that requirement. (Although I do still think that more often than hot having both a requirement and a booking would make sense!)
Available Duration Minimum
If you want to always book all of your “job” to one resource at the same time, then set this field to 100%.
A lower value might be required if you typically want to split a requirement across multiple resources. Maybe you’d be happy to give 50% of the work to one person and 50% to another. How you set this field will depend on the nature of the work your trying to schedule.
I guess it will be common to always want the same person to start and finish the task, in which case 100% would be your required setting.
Enable Quick Book
Quick book can be a very useful feature if you need to directly book your jobs without using the resource requirement step.
I hadn’t used quick book before, you might want to give it a try. It is really quite cool! Instead of creating a resource requirement and then booking that, with quick book we have a book button on the entity to be scheduled. This then opens a panel on the right hand side of the screen which allows you to quickly book the entity. Simply select the required date, a time slot and one of the available resources. You can then click book which creates a booking requirement and associated bookable resource booking without having to open either entity. If you need to do filtering of resources (etc) then this option might not be for you but for simple booking scenarios quick book provides a really simple user interface.
The attribute mapping section will define the mappings between your custom entity and the resource requirement. It is this the “joins” the custom fields I described earlier to the resource requirement. You can see below that I have linked each option to one of my custom fields.
If your entity does not contain a field of a suitable type the option will be greyed out. Hence why I described exactly what data type and formatting will be required for each one!
Resource Requirement & Bookable Resource Booking Form Changes
Next I made a couple of really simple form changes. We have just created a relationship between our custom entity and resource requirements and bookable resource booking entities. This means that we can use the related option to navigate to either of these entities from our custom entity.
Depending on your requirement adding a sub grid for these related entities to your general tab might be useful!
That is great but I wanted to be able to navigate to my custom entity from a resource requirement or a bookable resource booking. This was of particular relevance when I opened a booking from the schedule board. As I’d want to be able to easily navigate to the entity being booked.
By creating the relationship a lookup will have been created between each of these entities. You can see below that I have added this lookup to the bookable resource booking. (I did exactly the same thing with the resource requirement form.)
Tip: Depending on your requirement also adding a quick view from your custom entity may be quiet useful. As users could then see key attributed from the entity being booked without having to actually navigate to it.
Below you can see how I added the lookup field to my bookable resource booking form. The lookup field created simply had a display name that matched the name of my custom entity. I guess you could change that if required!
Schedule Board Changes
Assuming you aren’t using Project Service and Field Service you might want to make references to those “disappear” on your schedule board. It might also be useful to have a view of any requirements for your custom entity that need to be scheduled.
Below you can see that by default my schedule board includes all open requirements, projects and unscheduled work orders. Assuming you want to use “just” URS without Field Service or project Service maybe you’d like some of these options to not be present.
Before we make changes to the schedule board you’ll need to create a view that meets your requirements. Below you can see that I have created a view of open resource requirements for my custom entity. This is a system view on the resource requirement entity.
Tip: You could copy one of the existing views on resource requirements and simple “tweak” that!
For my view I simply copied the existing open resource requirements view. I then added additional filtering to ensure only open requirements for my custom entity were included. You may also want to tailor the columns displayed to ensure just the information relevant to your users is displayed. Below you can see my revised filtering on the view. With my custom entity added and also a check as I only want to include active record from my custom entity.
Once you’ve created a view that is suitable for you purposes you’ll want to add it to your schedule board. And maybe hide the out of the box views. Notice below that I am only showing “Neil’s Custom Entity”. To make this change click the cog on your dashboard. And then select “Open Tab Settings”. (Highlighted below.)
In the tab settings scroll down to the bottom and open the section headed “Requirements Panel”. Firstly select the option that says “Hide default requirement panels”. This will make the out of the box views disappear.
You can than enter whatever title you like for your view and pick it in the view selector. Pressing “+” will then added your view. You could (of course) add multiple views, maybe you’d want a separate view for high priority “jobs” or maybe you’d like to filter them into some other logical grouping.
Mappings on Bookable Resource Booking!
Next I did some additional mapping of fields manually! (This step is completely optional!!)
We saw previously that in the metadata I selected which of my custom fields to map to the resource requirement entity. In my example I wanted to be able to also directly create a booking without having to first create a resource requirement. If you need to do this you might want to add some custom mappings to the bookable resource booking.
Tip: I did this change using the classic version of customizations. As I don’t think you can (yet) alter the mappings directly in the new wed.powerapps.com!
To enter the mappings, I opened my custom entity and reviewed the relationships. I found the relationship that linked it with the bookable resource booking entity. Then in the mappings option I related my custom columns with appropriate columns on the bookable resource booking entity.
I also mapped the name field of my custom entity to the name field on the bookable resource booking entity. As it seemed logical to me for both records to share the same name!
Migration of Solution from Sandbox to Production
All of the changes I have described above were completed within a solution I’d created in my sandbox environment. Having made all the changes I decided to export as a managed solution and move into a production environment. Simply to check that the metadata (and other changes) exported as I expected! I thought I would share my experience of doing this with you ….
So first I ran the solution checker on my solution .… it reported no issues. This is what I expected but I advise you to always run the solution checker!!
I exported my solution as a managed solution and tried to import into production. It failed! On my first attempt I found my import failed as I had an older version of Project Service installed in production. I mention this as you might also want to check that your production instance and sandbox have the latest versions installed before you start.
Additionally when I made my custom entity a schedulable entity two lookup fields and therefore two relationships were automatically created, one on resource requirements and one on bookable resource booking. You will need to make sure you add these automatically created fields and relationships into your solution. (Tip, They will all be new_ something!)
What you will find is that your custom entity and any other changes you make to resource requirements and bookable resource bookings will import as you’d expect. Additionally the entity meta data will import. You will however need to repeat any configurations you make to the schedule board as they aren’t included in your solution.
I hope this rather long and detailed post has been helpful to anyone experimenting with Universal Resource Scheduler … overall my experience of using it has been very positive. I’m very impressed with how easy my changes were and I will certainly be using it on a live project very soon!