The error message "You can't configure a booking on this service using legacy scheduling experience" clearly indicates that the Service record you are trying to book against is configured to use the Unified Interface scheduling experience, while your code is likely attempting to use the older, legacy scheduling methods.
With the introduction of the Unified Interface, Microsoft has transitioned to a new scheduling engine and interface. The legacy methods and configurations are no longer compatible with services configured for this new experience.
Here's a breakdown of why this is happening and how to resolve it:
Understanding the Issue:
BookRequest
and SearchRequest
classes will result in this error.How to Resolve It:
You need to adapt your code to use the Unified Interface scheduling APIs. This typically involves using the following:
ScheduleRequest
Class: This class is part of the Unified Interface scheduling API and is used to find available time slots for resources based on the requirements of the service activity.BookServiceRequest
Class: This class is used to create the actual booking (BookableResourceBooking) based on the selected time slot and resources.Steps to Update Your Code:
SearchRequest
with ScheduleRequest
: Modify your code to use the ScheduleRequest
class instead of SearchRequest
to find available resources and time slots. This request will require parameters that define the service, required resources, duration, and scheduling constraints.BookRequest
with BookServiceRequest
: Once you have identified an available time slot and resources using ScheduleRequest
, use the BookServiceRequest
class to create the booking. This request will take parameters like the selected resource, start and end time, and the service activity.
Example (Conceptual - You'll need to adapt this to your specific requirements and field names):
Key Changes and Considerations:
ScheduleRequest
: Used to find available slots. You'll need to construct the Query
(FetchXML) to specify which resources are considered for scheduling. This might involve filtering by roles, skills, or other criteria.BookServiceRequest
: Used to create the actual booking.BookableResource
records. Your ScheduleRequest
's FetchXML needs to target this entity.ScheduleResponse
will return an array of TimeCode
objects representing available time slots and the associated resources.IOrganizationService
instance available. You'll need to adapt the example usage to fit within your plugin's Execute
method.ScheduleRequest
is a basic example. You'll likely need to make it more specific based on your resource requirements.In summary, the error you are encountering indicates a mismatch between the scheduling API you are using (legacy BookRequest
and SearchRequest
) and the configuration of the Service record (using Unified Interface scheduling). You need to update your code to use the ScheduleRequest
and BookServiceRequest
classes from the Unified Interface scheduling API to interact with these services. Review the Microsoft Dynamics 365 documentation for the Unified Interface scheduling APIs for more detailed information and examples.
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Vahid Ghafarpour
78
Super User 2025 Season 1
Sahra
43