我试图使用web API在Dynamics 365中创建一个批量删除作业。作为参考,我使用了以下网页:
var relativeUrl = "BulkDelete()";
var bulkDelete = new BulkDeleteRequest("Delete all future bookings");
var querySet = new QuerySet();
querySet.EntityName = "bookableresourcebooking";
querySet.Distinct = false;
var conditionStarttimeGreaterEqualToday = new Condition();
conditionStarttimeGreaterEqualToday.AttributeName = "starttime";
conditionStarttimeGreaterEqualToday.Operator = "OnOrAfter";
conditionStarttimeGreaterEqualToday.Values = new List<ValueClass>();
conditionStarttimeGreaterEqualToday.Values.Add(new ValueClass(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day).ToUniversalTime().ToString("o"), "System.DateTime"));
var conditionVoltooidOpEmpty = new Condition();
conditionVoltooidOpEmpty.AttributeName = "new_voltooidop";
conditionVoltooidOpEmpty.Operator = "Null";
conditionVoltooidOpEmpty.Values = new List<ValueClass>();
querySet.Criteria = new Criteria();
querySet.Criteria.FilterOperator = "And";
querySet.Criteria.Conditions.Add(conditionStarttimeGreaterEqualToday);
querySet.Criteria.Conditions.Add(conditionVoltooidOpEmpty);
bulkDelete.QuerySet.Add(querySet);
await _crmClient.PostCRMData(relativeUrl, JsonConvert.SerializeObject(bulkDelete)); //Dependency injected httpclient.
额外信息:
我们必须使此作业异步,为此,我们必须传递runnow:false
。那么这个错误就会消失。
我已经在CRM REST Builder中测试了这个工作代码。但这是JS等价的。
var parameters = {};
var queryset1 = {
EntityName: "account",
ColumnSet: {
AllColumns: true
},
Distinct: false,
};
queryset1["@odata.type"] = "Microsoft.Dynamics.CRM.QueryExpression";
parameters.QuerySet = [queryset1];
parameters.JobName = "arun test";
parameters.SendEmailNotification = false;
var torecipients1 = {};
torecipients1.activitypartyid = "00000000-0000-0000-0000-000000000000"; //Delete if creating new record
torecipients1["@odata.type"] = "Microsoft.Dynamics.CRM.activityparty";
parameters.ToRecipients = [torecipients1];
var ccrecipients1 = {};
ccrecipients1.activitypartyid = "00000000-0000-0000-0000-000000000000"; //Delete if creating new record
ccrecipients1["@odata.type"] = "Microsoft.Dynamics.CRM.activityparty";
parameters.CCRecipients = [ccrecipients1];
parameters.RecurrencePattern = "FREQ=DAILY;";
parameters.StartDateTime = JSON.stringify(new Date("05/07/2021 13:30:00").toISOString());
parameters.RunNow = false;
var bulkDeleteRequest = {
QuerySet: parameters.QuerySet,
JobName: parameters.JobName,
SendEmailNotification: parameters.SendEmailNotification,
ToRecipients: parameters.ToRecipients,
CCRecipients: parameters.CCRecipients,
RecurrencePattern: parameters.RecurrencePattern,
StartDateTime: parameters.StartDateTime,
RunNow: parameters.RunNow,
getMetadata: function() {
return {
boundParameter: null,
parameterTypes: {
"QuerySet": {
"typeName": "Collection(mscrm.QueryExpression)",
"structuralProperty": 4
},
"JobName": {
"typeName": "Edm.String",
"structuralProperty": 1
},
"SendEmailNotification": {
"typeName": "Edm.Boolean",
"structuralProperty": 1
},
"ToRecipients": {
"typeName": "Collection(mscrm.activityparty)",
"structuralProperty": 4
},
"CCRecipients": {
"typeName": "Collection(mscrm.activityparty)",
"structuralProperty": 4
},
"RecurrencePattern": {
"typeName": "Edm.String",
"structuralProperty": 1
},
"StartDateTime": {
"typeName": "Edm.DateTimeOffset",
"structuralProperty": 1
},
"RunNow": {
"typeName": "Edm.Boolean",
"structuralProperty": 1
}
},
operationType: 0,
operationName: "BulkDelete"
};
}
};
Xrm.WebApi.online.execute(bulkDeleteRequest).then(
function success(result) {
if (result.ok) {
var results = JSON.parse(result.responseText);
}
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);
我已经按照较新的SDK的建议实现了批量删除。创建了要删除每个项目的任务列表,然后等待所有任务。我的 CosmosClient 配置了 BulkOperations = true。据我所知,这意味着在引擎盖下,新的SDK发挥了魔力并执行批量操作。 不幸的是,我遇到了429响应状态。这意味着我的多个请求达到了请求速率限制(它很低,仅限于开发层,但不限于此)。我想知道,一个批量操作怎么会导致429错误。
在本例中,我在一个包含2个副本的部署中运行“echoheaders”Nginx。当我删除一个pod时,我有时会收到约40秒的缓慢响应和错误。 我们正在库伯内特斯运行我们的API网关,并且需要能够允许库伯内特斯调度程序在它认为合适的时候处理pod。 我们最近想引入会话相关性,为此,我们想迁移到新的闪亮的NEG:网络endpoint组:https://cloud.google.com/load-bal
本文向大家介绍mysql批量删除大量数据,包括了mysql批量删除大量数据的使用技巧和注意事项,需要的朋友参考一下 mysql批量删除大量数据 假设有一个表(syslogs)有1000万条记录,需要在业务不停止的情况下删除其中statusid=1的所有记录,差不多有600万条, 直接执行 DELETE FROM syslogs WHERE statusid=1 会发现删除失败,因为lock wai
我正在寻找一种有效的方法从我的存储帐户中删除blob列表。将有“大量”blob要删除,这些blob分布在“许多”容器中。 Azure存储客户端库是否提供任何机制来删除
下面是命令table exists,file exists on server: 谢谢你托马斯
本文向大家介绍mysql 大表批量删除大量数据的实现方法,包括了mysql 大表批量删除大量数据的实现方法的使用技巧和注意事项,需要的朋友参考一下 问题参考自:https://www.zhihu.com/question/440066129/answer/1685329456 ,mysql中,一张表里有3亿数据,未分表,其中一个字段是企业类型,企业类型是一般企业和个体户,个体户的数据量差不多占50