Applies to: Dynamics 365 Organization 9.0+ with Universal Resource Scheduling 3.8.x version
In the latest Field Service v8.8.x/Universal Resource Scheduling v3.8.x update, we released the Search Resource Availability API for scheduling single requirements. A list of available resources and their time slots can be retrieved by passing the details of a single resource requirement to this API as input. In this blog post, we will walk you through a scenario with an example of how to use this API.
Let’s consider this scenario: You are looking for list of available resources and their time slots for a requirement in which you have specific constraints—from and to dates of the requirement, duration of the requirement, effort needed for the requirement, resource types, resource characteristics, rating, roles, territories, organizational units, and resource preferences (preferred and restricted resources).
To be precise, in our example we are looking for available robotics technicians (resources: account, contact, user) for three hours of work over the next three days, who are familiar with assembly maintenance in the Washington territory and belong to the organizational units Seattle OU or Redmond OU.
Here is the list of input parameters used for our resource requirement and the exact values used in our example:
|Value used in this example
|Version number of the API to be called
|From Date on the requirement
|Date and Time
|To Date on the requirement
|Date and Time
|Next 3 days
|Duration in minutes
|3 hours = 180 mins
|Effort/capacity needed for the requirement
|The type of resource needed for the requirement (example: account, contact, crew)
|2,3,5 (account, contact, user)
|Resources to be excluded from the available resource suggestions
(Brady Hannon/Edgar Ramirez)
|Resources to be included in the available resource suggestions
(Jorge Gault, Joseph Gonsalves)
|Bookable resource characteristics needed for the requirement
|‘FAC12CAB-1BE7-E611-8102-E0071B69FFE1’ (Assembly Maintenance)
|Minimum rating needed for a resource characteristic on the requirement
|Resource categories/roles needed for the requirement
|‘EB357955-1AE7-E611-80F4-E0071B661F01’ (Robotics Technician)
|Resource territories needed for the requirement
|Resource organization units required for the requirement
- To run this API, we are going to need the GUIDs for the bookable resources, characteristics, roles, territories, and organizational units, which you can retrieve using the Web API.
- The extended SOAP SDK is not a Microsoft official release but is provided in the sample for guidance.
- We suggest you test this in your development or test environments first to validate your scenarios and results before you run it in your production environments.
To execute this search against your organization, you can download the sample files here. Once you download the sample folder, follow these steps:
- Modify the hard-coded input parameters provided in the sample.js file to reflect the GUIDs of records (for example, resources, characteristics, territories) in your org.
- Add the files in the sample folder as web resources in your organization.
- Navigate to the newly added sample.htm page. It would look like <<YourOrgURL>>//WebResources/new_sample.htm.
- Open the browser’s developer tools by using the F12 function key. Set breakpoints as needed and inspect the request/responses in the developer tool’s console.
We can see the list of time slots returned for the resources who match the search criteria with time slot types Off, Available, Scheduled returned. Jorge Gault and Joseph Gonsalves are the two potential resources who can fulfill our Resource Requirement/Work Order between the times of 09:00 to 17:00 hours GMT on June 26th and 27th.
Once these time slots are returned by the API, you could choose to display the available time slots on your custom web portal, app or a canvas app. If the user chooses an available time slot, you could use your custom logic to create a booking.
A few other scenarios that could leverage the API are as follows:
- Build a custom web app or a Dynamics 365 portal to provide appointment scheduling for their end users to show the available time slots for the service/product they offer from a Dynamics 365 CE organization data.
- Build a PowerApps canvas app to support scheduling scenarios for their line-of-business apps.
Program Manager, Dynamics 365 Engineering
Docs: The primary documentation for Dynamics 365 for Field Service
Scheduling Docs: Documentation for Universal Resource Scheduling
Learn: Tutorials for Universal Resource Scheduling
Field Service YouTube channel: Includes concept videos for Field Service
Ideas portal: Contribute product feedback and ideas for Universal Resource Scheduling
Forum: Go here to ask questions, find answers, and see upcoming events
Blogs: Ongoing release notes and posts from the product team