CRM 2016 provides odata / web api and has functions and actions out of the box.
In the organizationβs service, we can send a request as follows:
RequiredResource vanReq = new RequiredResource
{
ResourceId = _vanId,
ResourceSpecId = _specId
};
AppointmentRequest appointmentReq = new AppointmentRequest
{
RequiredResources = new RequiredResource[] { vanReq },
Direction = SearchDirection.Backward,
Duration = 60,
NumberOfResults = 10,
ServiceId = _plumberServiceId,
SearchWindowStart = DateTime.Now.ToUniversalTime(),
SearchWindowEnd = DateTime.Now.AddDays(7).ToUniversalTime(),
UserTimeZoneCode = 1
};
SearchRequest search = new SearchRequest
{
AppointmentRequest = appointmentReq
};
SearchResponse searched = (SearchResponse)_serviceProxy.Execute(search);
if (searched.SearchResults.Proposals.Length > 0)
{
Console.WriteLine("Openings are available to schedule the resource.");
}
Is it possible to simulate this functionality with functions / actions or any other odata functions?
I believe the query should be something like this:
crmOrg/api/v8.1/Search(AppointmentRequest=@request)?@request=
However, I'm not sure how to encode the rest of the request.
source
share