DeleteRequest Class

Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online

Contains the data that is needed to delete a record.

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

Syntax

'Declaration
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/xrm/2011/Contracts")> _
Public NotInheritable Class DeleteRequest
    Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/xrm/2011/Contracts")] 
public sealed class DeleteRequest : OrganizationRequest

Remarks

Message Availability

Not all entity types support this message offline. For some supported entities, this message works regardless whether the caller is connected to the server or offline. For other entities, the caller must be connected to the server before the message works. For more information, see Supported Entities later in this topic.

Usage

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

Privileges and Access Rights

To perform this action, the caller must have privileges on the specified entity in the Target property and access rights on the specified record in the Target property. For a list of the required privileges, see Delete Privileges.

Notes for Callers

This message deletes a record and its related records in one transaction. For a less complex method that deletes a single record, use the Delete method.

When a record is deleted, all child records are also deleted. The entire deletion fails if the caller does not have the delete privilege or access rights for any of these records. This method may cascade to related records according to the cascade configuration for each entity relationship. For a description of how actions on a parent record affect related records, see Cascading Behavior.

Typically, you should only delete records that you entered by mistake. For some record types, you can deactivate or close the record instead.

Supported Entities

You can use this method to delete any record of an entity (includes custom entities) that supports the DeleteRequest message.

The following table shows the default entities that support this message. For the listed entities of this message, the Availability column shows Server if the caller must be connected to the server and shows Both if the caller can be either connected to, or disconnected from, the server.

Entity Availability

account

Both

activitymimeattachment

Both

annotation

Both

annualfiscalcalendar

Both

appointment

Both

asyncoperation

Server

attributemap

Server

bulkdeleteoperation

Server

bulkoperation

Server

businessunit

Server

businessunitnewsarticle

Both

calendar

Both

campaign

Both

campaignactivity

Both

campaignresponse

Both

columnmapping

Both

competitor

Both

connection

Both

connectionrole

Both

connectionroleobjecttypecode

Both

constraintbasedgroup

Both

contact

Both

contract

Server

contractdetail

Server

contracttemplate

Server

customeraddress

Both

customeropportunityrole

Both

customerrelationship

Both

discount

Server

discounttype

Server

duplicaterule

Server

duplicaterulecondition

Server

email

Both

equipment

Server

emailserverprofile

Server

fax

Both

fieldpermission

Server

fieldsecurityprofile

Server

fixedmonthlyfiscalcalendar

Both

goal

Server

goalrollupquery

Server

import

Both

importentitymapping

Both

importfile

Both

importjob

Both

importmap

Both

incident

Both

incidentresolution

Both

invoice

Both

invoicedetail

Both

isvconfig

Server

kbarticle

Both

kbarticlecomment

Both

kbarticletemplate

Both

lead

Both

letter

Both

list

Server

lookupmapping

Both

mailbox

Server

mailmergetemplate

Both

metric

Server

monthlyfiscalcalendar

Both

msdyn_postalbum

Server

msdyn_postconfig

Server

msdyn_postruleconfig

Server

opportunity

Both

opportunityclose

Both

opportunityproduct

Both

orderclose

Both

ownermapping

Both

phonecall

Both

picklistmapping

Both

pluginassembly

Server

plugintype

Server

post

Server

postcomment

Server

postfollow

Server

postlike

Server

pricelevel

Both

principalobjectattributeaccess

Server

processsession

Both

product

Both

productpricelevel

Both

publisher

Server

publisheraddress

Server

quarterlyfiscalcalendar

Both

queue

Server

queueitem

Both

quote

Both

quoteclose

Both

quotedetail

Both

recurrencerule

Both

recurringappointmentmaster

Both

relationshiprole

Both

relationshiprolemap

Both

report

Server

reportcategory

Server

reportentity

Server

reportvisibility

Server

resourcespec

Both

role

Server

rollupfield

Server

salesliterature

Server

salesliteratureitem

Server

salesorder

Both

salesorderdetail

Both

savedquery

Server

savedqueryvisualization

Server

sdkmessageprocessingstep

Server

sdkmessageprocessingstepimage

Server

sdkmessageprocessingstepsecureconfig

Server

semiannualfiscalcalendar

Both

service

Server

serviceappointment

Both

serviceendpoint

Server

sharepointdocumentlocation

Server

sharepointsite

Server

site

Server

solution

Server

subject

Both

systemform

Server

task

Both

team

Server

template

Both

territory

Server

tracelog

Both

transactioncurrency

Server

transformationmapping

Both

transformationparametermapping

Both

uom

Server

uomschedule

Both

userentityinstancedata

Both

userentityuisettings

Both

userform

Server

userquery

Both

userqueryvisualization

Both

webresource

Server

workflow

Server

workflowdependency

Server

workflowlog

Server

Inheritance Hierarchy

System.Object
   Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Xrm.Sdk.Messages.DeleteRequest

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.

Platforms

Development Platforms

Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)

Target Platforms

Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions),

See Also

Reference

DeleteRequest Members
Microsoft.Xrm.Sdk.Messages Namespace
DeleteResponse
IOrganizationService.Delete Method

Other Resources

Delete Privileges
Use the Early Bound Entity Classes for Create, Update, and Delete

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.