Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ValidateRequest Class

Definition

Namespace:
Microsoft.Crm.Sdk.Messages
Assembly:
Microsoft.Crm.Sdk.Proxy.dll
Package:
Microsoft.PowerPlatform.Dataverse.Client v1.2.10

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Contains the data that is needed to verify that an appointment or service appointment (service activity) has valid available resources for the activity, duration, and site, as appropriate.

public ref class ValidateRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class ValidateRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")>]
type ValidateRequest = class
 inherit OrganizationRequest
Public NotInheritable Class ValidateRequest
Inherits OrganizationRequest
Inheritance
ValidateRequest
Attributes

Examples

The following example shows how to use this message. For this sample to work correctly, you must have an authenticated connection to the server with a client that implements the IOrganizationService interface instance.

/// <summary>
/// Validates an appointment
/// </summary>
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
/// <param name="appointmentId">The id of the appointment to be validated.</param>
static void ValidateExample(IOrganizationService service, Guid appointmentId) {

 // Retrieve the appointment to be validated
 Entity retrievedAppointment = service.Retrieve(
 entityName: "appointment",
 id: appointmentId,
 columnSet: new ColumnSet("scheduledstart", "scheduledend", "statecode", "statuscode")
 );

 // Use the Validate message
 var request = new ValidateRequest {
 Activities = new EntityCollection
 {
 Entities = {
 { retrievedAppointment }
 },
 EntityName = "appointment"
 }
 };

 var response = (ValidateResponse)service.Execute(request);

 // Verify success
 response.Result.ToList().ForEach(appt => {
 Console.WriteLine($"ValidationSuccess:{appt.ValidationSuccess}"); 
 });
} 

Remarks

For the Web API use the Validate action.

Usage

Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of the ValidateResponse class.

Privileges and Access Rights

To perform this action, the caller must have access rights on the specified entities in the Activities property.

Each activity record in the Activities property must have a valid Guid value for Id.

Constructors

Name Description
ValidateRequest()

Initializes a new instance of the ValidateRequest class.

Properties

Name Description
Activities

Gets or sets the activities to validate.

ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId

Gets or sets the ID of the request. Optional.

(Inherited from OrganizationRequest)
RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)

Applies to

See also