Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Unable to retrieve working hours for BookableResource using QueryScheduleRequest/QueryMultipleSchedulesRequest

$
0
0

I'm trying to retrieve the working hours for a BookableResource ("Generic" resource type) via the SDK using the code below:

            QueryMultipleSchedulesRequest scheduleRequest = new QueryMultipleSchedulesRequest();
            scheduleRequest.ResourceIds = listBR.ToArray(); //List of BookableResourceId's
            scheduleRequest.Start = DateTime.Now;
            scheduleRequest.End = DateTime.Today.AddMonths(2);
            scheduleRequest.TimeCodes = new TimeCode[] { TimeCode.Available };
            QueryMultipleSchedulesResponse scheduleResponse = (QueryMultipleSchedulesResponse)service.Execute(scheduleRequest);

The QueryScheduleRequest/QueryMultipleSchedulesRequest methods error when passing through a BookableResourceId and reports the resource doesn't exist:

Resource With Id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx Does Not Exist

The BookableResource exists and has an associated CalendarId, but I'm guessing the method doesn't support the field service entity, only users and equipment.

Can anyone confirm this and offer any workarounds? I can query the Calendar entities and derive the working hours manually, but it will involve multiple service requests which I'm trying to avoid.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>