Export (0) Print
Expand All
Expand Minimize

Validate Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online and offline

Verifies that an appointment or service appointment (service activity) has valid available resources for the activity, duration, and site as appropriate.

The relevant classes are specified in the following table.

TypeClass
RequestValidateRequest
ResponseValidateResponse
Entityappointment or serviceappointment

Remarks

To use this message, pass an instance of the ValidateRequest class as the request parameter in the Execute method.

To perform this action, the caller must have access rights on the entity instance specified in the request class. For a list of required privileges, see Validate Privileges.

Example

The following code example shows how to use the Validate message.

[C#]
// Set up the CRM service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the request object.
ValidateRequest validate = new ValidateRequest();

// Set the properties of the request object.
validate.Activities = new BusinessEntityCollection();
validate.Activities.EntityName = EntityName.appointment.ToString();
validate.Activities.BusinessEntities = new BusinessEntity[1];
validate.Activities.BusinessEntities[0] = retrieved;
   
// Execute the request.
ValidateResponse validated = (ValidateResponse)service.Execute(validate);
[Visual Basic .NET]
' Set up the CRM service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the request object.
Dim validate As New ValidateRequest()

' Set the properties of the request object.
validate.Activities = New BusinessEntityCollection()
validate.Activities.EntityName = EntityName.appointment.ToString()
validate.Activities.BusinessEntities = New BusinessEntity(0) {}
validate.Activities.BusinessEntities(0) = retrieved

' Execute the request.
Dim validated As ValidateResponse = CType(service.Execute(validate), ValidateResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft