当前位置: 首页 > news >正文

Power Apps 学习笔记 -- OrganizationRequestCollection

文章目录

    • 1. OrganizationRequestCollection 简介
    • 2. OrganizationRequestCollection
      • 2.1 OrganizationRequest 使用
      • 2.2 OrganizationRequestCollection 使用

1. OrganizationRequestCollection 简介

  OrganizationRequestCollection 链接 : OrganizationRequestCollection

OrganizationRequestCollection 类:
public ref class OrganizationRequestCollection sealed : 
Microsoft::Xrm::Sdk::DataCollection<Microsoft::Xrm::Sdk::OrganizationRequest ^>
继承层次:Collection<T> -> DataCollection<OrganizationRequest> -> OrganizationRequestCollectionCollection提供了操作集合的基类,并且提供了基础的增删改查方法, DataCollection<> 继承了 Collection的
同时自己也提供了一些扩展方法, OrganizationRequest 是用于与数据库数据请求与交互的基类。OrganizationRequestCollection 综上可知,其是大批量事务执行的容器,可以用于储存多个基本的Organization
Request。常可以用于大批量的事务操作执行,提升与数据库的执行效率.
使用方法:基本单个的OrganizationRequest可以直接通过 IOrganizationService.Execute(OrganizationRequest) Method
可以通过 IOrganizationService直接执行即可对于OrganizationRequestCollection这个内部为多个请求所组成的数据请求集合,系统提供了继承Organization
Request的 ExecuteMultipleRequest 类,该类用于大批量的数据请求执行。

2. OrganizationRequestCollection

服务数据请求的基类 OrganizationRequest, 接下来逐个介绍常用的该基类的实现类,介绍其相关特性。

  OrganizationRequest 链接 : OrganizationRequest Class

2.1 OrganizationRequest 使用

CreateRequest

Guid guid = Guid.NewGuid();
Entity entity = new Entity("crda9_order");
entity["crda9_reason"] = "CreateReques 建立测试....";
entity.Id = guid;CreateRequest request = new CreateRequest(){Target = entity
};
OrganizationService.Execute(request);

UpdateRequest

Entity entity = new Entity("crda9_order");
entity["crda9_reason"] = "CreateReques 建立修改测试....";
entity.Id = new Guid("ba7cb4b9-8756-40de-9c73-18b6fa371bac");UpdateRequest request = new UpdateRequest(){Target = entity
};
OrganizationService.Execute(request);

RetrieveRequest

RetrieveRequest retrieveRequest = new RetrieveRequest() {ColumnSet = new ColumnSet(true),Target = new EntityReference("crda9_order", new Guid("ba7cb4b9-8756-40de-9c73-18b6fa371bac"))
};
var response = OrganizationService.Execute(retrieveRequest);

RetrieveRequest

DeleteRequest deleteRequest = new DeleteRequest() {Target = new EntityReference("crda9_order", new Guid("5a987003-7edf-ee11-904c-002248ed45e4"))
};
var response = OrganizationService.Execute(deleteRequest);

2.2 OrganizationRequestCollection 使用

修改类操作通常中间不会进行查询操作,因为是批量执行,无法在批量执行前获取查询的值再进行处理。
 Entity entity = new Entity("crda9_order") { Id = Guid.NewGuid() };entity["crda9_reason"] = "建立01..";CreateRequest createRequest = new CreateRequest() {Target = entity};orColl.Add(createRequest);entity = new Entity("crda9_order") { Id = new Guid("ba7cb4b9-8756-40de-9c73-18b6fa371bac") };entity["crda9_reason"] = "修改02...";UpdateRequest updateRequest = new UpdateRequest() { Target = entity};orColl.Add(updateRequest);ExecuteMultipleRequest emRequest = new ExecuteMultipleRequest() {Settings = new ExecuteMultipleSettings() {ContinueOnError = true,ReturnResponses = true},Requests = orColl};var response = OrganizationService.Execute(emRequest);

http://www.lryc.cn/news/324883.html

相关文章:

  • python绘图matplotlib——使用记录1
  • Spring Data访问Elasticsearch----创建存储库实例
  • Wireshark TS | DNS 案例分析之外的思考
  • nginx集群部署访问不了怎么解决
  • 抖音小程序开发资质认证流程和资料
  • 【JAVA】通过JAVA实现用户界面的登录
  • UE5 C++ 3D血条 响应人物受伤 案例
  • 阿里云2核4G服务器支持多少人在线?2C4G多少钱一年?
  • 【STK】手把手教你利用STK进行导弹和反导仿真02 - STK/MMT模块01 导弹任务分析工具概述
  • 新台阶——蓝桥杯单片机省赛第十四届程序设计题目
  • php魔术方法
  • Linux系统——Mysql索引详解
  • Java22已发布,支持SpringBoot3.3.0正式版
  • 第二证券策略:关注部分华为板块、年报绩优品种反弹机会
  • IBM SPSS Statistics for Mac v27.0.1中文激活版
  • C# WPF编程-布局
  • 上位机图像处理和嵌入式模块部署(qmacvisual点线测量)
  • yolov5训练并生成rknn模型部署在RK3588开发板上,实现NPU加速推理
  • SCI一区 | Matlab实现SSA-TCN-BiGRU-Attention麻雀算法优化时间卷积双向门控循环单元融合注意力机制多变量时间序列预测
  • javaSwing宿舍管理系统(三个角色)
  • 蓝桥杯day12刷题日记
  • 深度学习pytorch——多分类问题(持续更新)
  • Flutter探索之旅:控制键盘可见性的神奇工具(flutter_keyboard_visibility)
  • 提升质量透明度,动力电池企业的数据驱动生产实践 | 数据要素 × 工业制造
  • 华为数通 HCIP-Datacom H12-831 题库补充
  • tensorflow中显存分配
  • STM32--RC522学习记录
  • 函数封装冒泡排序
  • mysql基础学习
  • mybatisplus提示:Property ‘mapperLocations‘ was not specified.