Del via


DeleteRequest Class

 

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

Contains the data that is needed to delete a deployment record.

Namespace:   Microsoft.Xrm.Sdk.Deployment
Assembly:  Microsoft.Xrm.Sdk.Deployment (in Microsoft.Xrm.Sdk.Deployment.dll)

Inheritance Hierarchy

System.Object
  Microsoft.Xrm.Sdk.Deployment.DeploymentServiceRequest
    Microsoft.Xrm.Sdk.Deployment.DeleteRequest
      Microsoft.Xrm.Sdk.Deployment.DeleteOrganizationRequest

Syntax

[DataContractAttribute(Name = "DeleteRequest", Namespace = "https://schemas.microsoft.com/xrm/2011/Contracts/Deployment")]
[KnownTypeAttribute(typeof(DeleteOrganizationRequest))]
public class DeleteRequest : DeploymentServiceRequest
<DataContractAttribute(Name := "DeleteRequest", Namespace := "https://schemas.microsoft.com/xrm/2011/Contracts/Deployment")>
<KnownTypeAttribute(GetType(DeleteOrganizationRequest))>
Public Class DeleteRequest
    Inherits DeploymentServiceRequest

Constructors

Name Description
System_CAPS_pubmethod DeleteRequest()

Initializes a new instance of the DeleteRequest class.

Properties

Name Description
System_CAPS_pubproperty EntityType

Gets or sets the type of deployment entity to be deleted.

System_CAPS_pubproperty ExtensionData

Gets or sets the structure that contains extra data.(Inherited from DeploymentServiceRequest.)

System_CAPS_pubproperty InstanceTag

Gets or sets the ID or the instance tag for the deployment record to be deleted.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Remarks

Pass an instance of this class to the Execute method, which returns an instance of DeleteResponse.

Note that this is the Deployment Web Service. To delete organization data records in Microsoft Dynamics 365, use DeleteRequest.

Examples

The following code shows how to delete an organization.

using (DeploymentServiceClient client = new DeploymentServiceClient("CustomBinding_IDeploymentService"))
{
    EntityInstanceId id = new EntityInstanceId
    {
        Name = "AlpineSkiHouse2"
    };

    // disable the organization
    Organization organization = (Organization)client.Retrieve(DeploymentEntityType.Organization, id);
    organization.State = OrganizationState.Disabled;
    client.Update(organization);


    // delete the organization
    DeleteRequest request = new DeleteRequest
    {
        EntityType = DeploymentEntityType.Organization,
        InstanceTag = id
    };
    DeleteResponse response = (DeleteResponse)client.Execute(request);

    client.Close();
}

Thread Safety

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

See Also

DeleteResponse
Microsoft.Xrm.Sdk.Deployment Namespace
Introduction to the deployment web service

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright