AppointmentRequest Class

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Provides the details of an appointment request for the AppointmentRequest class.

For the Web API the corresponding type is AppointmentRequest ComplexType.

Namespace:   Microsoft.Crm.Sdk.Messages
Assembly:  Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

System.Object
  Microsoft.Crm.Sdk.Messages.AppointmentRequest

[DataContractAttribute(Namespace = "http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class AppointmentRequest : IExtensibleDataObject

NameDescription
System_CAPS_pubmethodAppointmentRequest()

Initializes a new instance of the AppointmentRequest class.

NameDescription
System_CAPS_pubpropertyAnchorOffset

Gets or sets the time offset in minutes, from midnight, when the first occurrence of the appointment can take place.

System_CAPS_pubpropertyAppointmentsToIgnore

Gets or sets the appointments to ignore in the search for possible appointments.

System_CAPS_pubpropertyConstraints

Gets or sets any additional constraints.

System_CAPS_pubpropertyDirection

Gets or sets the direction of the search.

System_CAPS_pubpropertyDuration

Gets or sets the appointment duration, in minutes.

System_CAPS_pubpropertyExtensionData

Gets or sets the structure that contains extra data.

System_CAPS_pubpropertyNumberOfResults

Gets or sets the number of results to be returned from the search request.

System_CAPS_pubpropertyObjectives

Gets or sets the scheduling strategy that overrides the default constraints.

System_CAPS_pubpropertyRecurrenceDuration

Gets or sets the time, in minutes, for which the appointment recurrence is valid.

System_CAPS_pubpropertyRecurrenceTimeZoneCode

Gets or sets a value to override the time zone that is specified by the UserTimeZoneCode property.

System_CAPS_pubpropertyRequiredResources

Gets or sets the resources that are needed for this appointment.

System_CAPS_pubpropertySearchRecurrenceRule

Gets or sets the recurrence rule for appointment recurrence.

System_CAPS_pubpropertySearchRecurrenceStart

Gets or sets the date and time for the first possible instance of the appointment.

System_CAPS_pubpropertySearchWindowEnd

Gets or sets the date and time to end the search.

System_CAPS_pubpropertySearchWindowStart

Gets or sets the date and time to begin the search.

System_CAPS_pubpropertyServiceId

Gets or sets the ID of the service to search for.

System_CAPS_pubpropertySites

Gets or sets the sites where the requested appointment can take place.

System_CAPS_pubpropertyUserTimeZoneCode

Gets or sets the time zone code of the user who is requesting the appointment.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.



// Create the van required resource object.
RequiredResource vanReq = new RequiredResource
{
    ResourceId = _vanId,
    ResourceSpecId = _specId
};

// Create the appointment request.
AppointmentRequest appointmentReq = new AppointmentRequest
{
    RequiredResources = new RequiredResource[] { vanReq },
    Direction = SearchDirection.Backward,
    Duration = 60,
    NumberOfResults = 10,
    ServiceId = _plumberServiceId,
    // The search window describes the time when the resouce can be scheduled.
    // It must be set.
    SearchWindowStart = DateTime.Now.ToUniversalTime(),
    SearchWindowEnd = DateTime.Now.AddDays(7).ToUniversalTime(),
    UserTimeZoneCode = 1
};

// Verify whether there are openings available to schedule the appointment using this resource              
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.");
}

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: