当前位置:网站首页>Dynamics 365: how to get the threshold value of executemullerequest in batch requests
Dynamics 365: how to get the threshold value of executemullerequest in batch requests
2022-07-24 15:40:00 【Stone-hdj】
When we execute ExecuteMultipleRequest When the batch request exceeds the maximum , The following errors will be reported :

But our code cannot be deployed web Service to directly query the size of the batch threshold , Unless it is running under an account with the deployment administrator role . But deployment administrators are not usually used for this .
Fortunately, , There is another way to use : When ExecuteMultipleRequest When the number of requests exceeds the maximum allowed by the organization ,ExecuteMultipleRequest An exception will be thrown . The maximum size will be returned in the exception . Your code can check this value , And will ExecuteMultipleRequest The requested size is adjusted to the specified limit , And resubmit .
try
{
ExecuteMultipleRequest requestWithResults = new ExecuteMultipleRequest()
{
// Assign settings that define execution behavior: continue on error, return responses.
Settings = new ExecuteMultipleSettings()
{
ContinueOnError = false,
ReturnResponses = true
},
// Create an empty organization request collection.
Requests = new OrganizationRequestCollection()
};
// Create entity records into a collection.
EntityCollection records = GetEntityCollectionForCreate();
// Add a CreateRequest for each entity to the request collection.
foreach (var entity in records.Entities)
{
CreateRequest createRequest = new CreateRequest { Target = entity };
requestWithResults.Requests.Add(createRequest);
}
// Execute all the requests
ExecuteMultipleResponse responseWithResults = (ExecuteMultipleResponse)service.Execute(requestWithResults);
}
catch (FaultException<OrganizationServiceFault> fault)
{
if (fault.Detail.ErrorDetails.Contains("MaxBatchSize"))
{
int maxBatchSize = Convert.ToInt32(fault.Detail.ErrorDetails["MaxBatchSize"]);
Console.WriteLine($"it exceeds the maximum allowed {maxBatchSize}");
}
// Re-throw so that Main() can process the fault.
throw;
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}Reference link :
边栏推荐
- AttributeError: module ‘seaborn‘ has no attribute ‘histplot‘
- 徽商期货平台安全吗?办理期货开户没问题吧?
- yolov6训练自己的数据集
- sklearn.metrics模块模型评价函数
- Intuitive understanding of various normalization
- 【ACWing】909. 下棋游戏
- [Luogu] p1908 reverse sequence pair
- Exomiser对外显子组变体进行注释和优先排序
- Error 1053: the service did not respond to the start or control request in a timely fashion
- Is it safe for Huatai Securities to open a mobile account and will it be leaked
猜你喜欢
![[machine learning basics] - another perspective to explain SVM](/img/da/3c379d225f9866ed1d3ca853920bd5.png)
[machine learning basics] - another perspective to explain SVM

Dynamics crm: how to set the order of forms

Kubernetes static storage and dynamic storage

Automatic derivation of pytorch

有了这个机器学习画图神器,论文、博客都可以事半功倍了!

yolov3 训练自己的数据集

Multus of kubernetes multi network card scheme_ CNI deployment and basic use

What is a firewall? What role can firewalls play?

被攻击怎么解决?DDoS高防IP防护策略

MATLAB image defogging technology GUI interface - global balance histogram
随机推荐
[shaders realize pixelate mosaic effect _shader effect Chapter 7]
Small list of iptables common commands
Configuring WAPI certificate security policy for Huawei wireless devices
C # exit login if there is no operation
What is a firewall? What role can firewalls play?
Citic securities account opening process, is it safe to open an account on your mobile phone
Fine tune layoutlm V3 for bill data processing and content recognition
[acwing] 909. Chess game
4279. Cartesian tree
Lsyncd real time synchronization
有了这个机器学习画图神器,论文、博客都可以事半功倍了!
Feign for 20 minutes every day
【TA-霜狼_may-《百人计划》】图形3.4 延迟渲染管线介绍
C. Recover an RBS
From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?
How to deal with being attacked? Advanced anti DDoS IP protection strategy
Force button 31. Next arrangement -- double finger needling
中信证券账户开通流程,手机上开户安全吗
微调LayoutLM v3进行票据数据的处理和内容识别
2022 robocom world robot developer competition - undergraduate group (provincial competition) CAIP full version solution
https://docs.microsoft.com/en-us/power-apps/developer/data-platform/org-service/execute-multiple-requests