应用到: CRM 2015 on-prem, CRM Online
Contains the data that’s needed to submit a bulk delete job that deletes selected records in bulk. This job runs asynchronously in the background without blocking other activities.
命名空间: Microsoft.Crm.Sdk.Messages
程序集: Microsoft.Crm.Sdk.Proxy (在 Microsoft.Crm.Sdk.Proxy.dll 中)
语法
声明
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class BulkDeleteRequest
Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class BulkDeleteRequest : OrganizationRequest
示例
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 a condition for a bulk delete request.
// NOTE: This sample uses very specific queries for deleting records
// that have been manually exported in order to free space.
QueryExpression opportunitiesQuery = BuildOpportunityQuery();
// Create the bulk delete request.
BulkDeleteRequest bulkDeleteRequest = new BulkDeleteRequest();
// Set the request properties.
bulkDeleteRequest.JobName = "Backup Bulk Delete";
// Querying activities
bulkDeleteRequest.QuerySet = new QueryExpression[]
{
opportunitiesQuery,
BuildActivityQuery(Task.EntityLogicalName),
BuildActivityQuery(Fax.EntityLogicalName),
BuildActivityQuery(PhoneCall.EntityLogicalName),
BuildActivityQuery(Email.EntityLogicalName),
BuildActivityQuery(Letter.EntityLogicalName),
BuildActivityQuery(Appointment.EntityLogicalName),
BuildActivityQuery(ServiceAppointment.EntityLogicalName),
BuildActivityQuery(CampaignResponse.EntityLogicalName),
BuildActivityQuery(RecurringAppointmentMaster.EntityLogicalName)
};
// Set the start time for the bulk delete.
bulkDeleteRequest.StartDateTime = DateTime.Now;
// Set the required recurrence pattern.
bulkDeleteRequest.RecurrencePattern = String.Empty;
// Set email activity properties.
bulkDeleteRequest.SendEmailNotification = false;
bulkDeleteRequest.ToRecipients = new Guid[] { currentUserId };
bulkDeleteRequest.CCRecipients = new Guid[] { };
// Submit the bulk delete job.
// NOTE: Because this is an asynchronous operation, the response will be immediate.
_bulkDeleteResponse =
(BulkDeleteResponse)_serviceProxy.Execute(bulkDeleteRequest);
Console.WriteLine("The bulk delete operation has been requested.");
备注
Message Availability
若要使此消息正常工作,调用方必须连接到服务器。
Usage
Pass an instance of this class to the Execute method, which returns an instance of the BulkDeleteResponse class.
Privileges and Access Rights
To perform this action, the caller must have read access rights on the entity records that are specified in the request class. The caller must also have Delete Privileges for the entity types being deleted. For a complete list of the required privileges, see BulkDelete Privileges.
Notes for Callers
By default, a system administrator has the BulkDelete privileges for bulk deletions. Other users must be granted the BulkDelete privileges before they can perform a bulk deletion.
When a record is deleted, all its child records are also deleted. The entire deletion fails if the caller doesn’t have delete privileges or access rights to perform bulk deletions for any of these records.
The deletion order of the related records depends on the cascade configuration for each entity relationship. For a description of how actions on a parent record can affect related records, see Entity Relationship Behavior.
Supported Entities
You can delete the records in bulk of an entity that supports the BulkDeleteRequest message, including custom entities.
下表显示支持此消息的默认实体。对于列出的实体,调用方必须连接到服务器才能使此消息可用。
| Entity | Availability |
|---|---|
account |
Server |
activitymimeattachment |
Server |
annotation |
Server |
annualfiscalcalendar |
Server |
appointment |
Server |
asyncoperation |
Server |
attributemap |
Server |
bulkdeleteoperation |
Server |
bulkoperation |
Server |
businessunit |
Server |
businessunitnewsarticle |
Server |
calendar |
Server |
campaign |
Server |
campaignactivity |
Server |
campaignresponse |
Server |
columnmapping |
Server |
competitor |
Server |
connection |
Server |
connectionrole |
Server |
connectionroleobjecttypecode |
Server |
constraintbasedgroup |
Server |
contact |
Server |
contract |
Server |
contractdetail |
Server |
contracttemplate |
Server |
customeraddress |
Server |
customeropportunityrole |
Server |
customerrelationship |
Server |
discount |
Server |
discounttype |
Server |
duplicaterule |
Server |
duplicaterulecondition |
Server |
Server |
|
equipment |
Server |
fax |
Server |
fieldpermission |
Server |
fieldsecurityprofile |
Server |
fixedmonthlyfiscalcalendar |
Server |
goal |
Server |
goalrollupquery |
Server |
import |
Server |
importdata |
Server |
importentitymapping |
Server |
importfile |
Server |
importjob |
Server |
importmap |
Server |
incident |
Server |
incidentresolution |
Server |
invoice |
Server |
invoicedetail |
Server |
isvconfig |
Server |
kbarticle |
Server |
kbarticlecomment |
Server |
kbarticletemplate |
Server |
lead |
Server |
letter |
Server |
list |
Server |
lookupmapping |
Server |
mailmergetemplate |
Server |
metric |
Server |
monthlyfiscalcalendar |
Server |
opportunity |
Server |
opportunityclose |
Server |
opportunityproduct |
Server |
orderclose |
Server |
ownermapping |
Server |
phonecall |
Server |
picklistmapping |
Server |
pluginassembly |
Server |
plugintype |
Server |
pricelevel |
Server |
principalobjectattributeaccess |
Server |
processsession |
Server |
product |
Server |
productpricelevel |
Server |
publisher |
Server |
publisheraddress |
Server |
quarterlyfiscalcalendar |
Server |
queue |
Server |
queueitem |
Server |
quote |
Server |
quoteclose |
Server |
quotedetail |
Server |
recurrencerule |
Server |
recurringappointmentmaster |
Server |
relationshiprole |
Server |
relationshiprolemap |
Server |
report |
Server |
reportcategory |
Server |
reportentity |
Server |
reportvisibility |
Server |
resourcespec |
Server |
role |
Server |
rollupfield |
Server |
salesliterature |
Server |
salesliteratureitem |
Server |
salesorder |
Server |
salesorderdetail |
Server |
savedquery |
Server |
savedqueryvisualization |
Server |
sdkmessageprocessingstep |
Server |
sdkmessageprocessingstepimage |
Server |
sdkmessageprocessingstepsecureconfig |
Server |
semiannualfiscalcalendar |
Server |
service |
Server |
serviceappointment |
Server |
serviceendpoint |
Server |
sharepointdocumentlocation |
Server |
sharepointsite |
Server |
site |
Server |
solution |
Server |
subject |
Server |
systemform |
Server |
task |
Server |
team |
Server |
template |
Server |
territory |
Server |
transactioncurrency |
Server |
transformationmapping |
Server |
transformationparametermapping |
Server |
uom |
Server |
uomschedule |
Server |
userentityinstancedata |
Server |
userentityuisettings |
Server |
userform |
Server |
userquery |
Server |
userqueryvisualization |
Server |
webresource |
Server |
webwizard |
Server |
wizardaccessprivilege |
Server |
wizardpage |
Server |
workflow |
Server |
workflowdependency |
Server |
workflowlog |
Server |
继承层次结构
System.Object
Microsoft.Xrm.Sdk.OrganizationRequest
Microsoft.Crm.Sdk.Messages.BulkDeleteRequest
线程安全性
此类型的所有公共静态(Visual Basic 中的 Shared)成员都是线程安全成员。不保证任何实例成员是线程安全成员。
平台
开发平台
Windows Vista、Windows Server 2003 和
目标平台
Windows Vista,Windows XP
Change History
另请参阅
参考
BulkDeleteRequest 成员
Microsoft.Crm.Sdk.Messages 命名空间
BulkDeleteResponse
其他资源
Delete Data in Bulk in Microsoft Dynamics CRM
Sample: Bulk Delete Exported Records
Sample: Bulk Delete Records That Match Common Criteria
BulkDelete Privileges
How Role-Based Security Can Be Used to Control Access to Entities in CRM
How Instance-Based Security Can Be Used to Control Access to Entity Instances (Records) in CRM
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.