Dynamics CRM 2015/2016新特性之三十三:有了ExecuteTransactionRequest,再也不用担心部分成功部分失败了
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query;
using System;
using System.Collections.Generic;
using System.IO;
using System.ServiceModel; namespace LuoYongLab
{
class Program
{
static void Main(string[] args)
{
try
{
var orgService = new OrganizationService(new CrmConnection("CRM"));
var testEntity1 = new Entity("ly_test");
testEntity1["ly_name"] = "这是通过ExecuteTransactionRequest消息处理的-1";
CreateRequest req1 = new CreateRequest();
req1.Target = testEntity1;
var testEntity2 = new Entity("ly_test", "ly_alternatekey", "");
testEntity2["ly_name"] = "这是通过ExecuteTransactionRequest消息处理的-2";
UpdateRequest req2 = new UpdateRequest();
req2.Target = testEntity2;
DeleteRequest req3 = new DeleteRequest()
{
Target = new EntityReference("ly_test", "ly_alternatekey", "")
};
ExecuteTransactionRequest req = new ExecuteTransactionRequest();
req.Requests = new OrganizationRequestCollection() { req1, req2, req3 };
orgService.Execute(req);
Console.WriteLine("程序运行完成");
Console.ReadKey();
}
catch (FaultException ex)
{
Console.WriteLine("程序出现异常:ex.Message=" + ex.Message);
Console.WriteLine("ex.StackTrace=" + ex.StackTrace);
Console.ReadKey();
}
}
}
}

Dynamics CRM 2015/2016新特性之三十三:有了ExecuteTransactionRequest,再也不用担心部分成功部分失败了的更多相关文章
- Dynamics CRM 2015/2016新特性之三十二:新增乐观并发处理
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复215或者20160328可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
- Dynamics CRM 2015/2016新特性之三十四:有了插件日志,调试插件so easy!
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复217或者20160330可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
- Dynamics CRM 2015/2016新特性之七:有了文档模板,打印分析So Easy
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复190或者20160216可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 从CRM 2015 UR1开始, ...
- Dynamics CRM 2015/2016 Web API:Unbound Action 和 Bound Action
上篇文章介绍了Bound/Unbound Function.今天我们来看看Action吧.像我之前说的:Function和Action之前的差别能够简单理解为.Function不改动数据,可是Acti ...
- Dynamics CRM 2015/2016 Web API:Unbound Function 和 Bound Function
今天我们来看看Dynamics CRM Web API Function 吧, 这是一个新概念,刚接触的时候我也是比較的迷糊.这种命名确实是和之前的那套基于SOAP协议的API全然联系不上.好了,不说 ...
- Dynamics CRM 2015/2016 Web API:Unbound Custom Action 和 Bound Custom Action
今天我们再来看看Bound/Unbound Custom Action吧,什么是Custom Action?不知道的小伙伴们就out了,Dynamics CRM 2013就有了这个功能啦.和WhoAm ...
- Dynamics CRM 2015/2016 Web API:新的数据查询方式
今天我们来看看Web API的数据查询功能,尽管之前介绍CRUD的文章里面提到过怎么去Read数据,可是并没有详细的去深究那些细节,今天我们就来详细看看吧.事实上呢,Web API的数据查询接口也是基 ...
- Dynamics CRM 2015/2016 Web API:聚合查询
各位小伙伴们,今天是博主2016年发的第一篇文章.首先祝大家新年快乐.工资Double,哈哈.今天我们来看一个比較重要的Feature--使用Web API运行FetchXML查询! 对的,各位.你们 ...
- 【原创】Dynamics CRM 2015/2016,以PDF的形式打开SSRS报表。
基本步骤: 使用SSRS建立报表,以下的例子是以记录的GUID作为报表的参数 获取ReportSession 和 ControlId来调用报表 以PDF的形式预览报表 一.根据报表的名称获取报表的GU ...
随机推荐
- Add a Simple Action添加简单按钮
In this lesson, you will learn how to create a Simple Action. For this purpose, a new View Controlle ...
- Customize the Application UI and Behavior 自定义应用程序UI和行为
In XAF, the business model defines the database structure and UI appearance. Changes to your persist ...
- log4j配置项
log4j 配置文件log4j.rootLogger=INFO,console,dailyFile# 控制台配置项log4j.appender.console=org.apache.log4j.Con ...
- Android 中的style和Theme的使用
说明 style和theme的定义是为了改变原有系统设定的默认窗体.字体.背景色.格式等风格而使用.其本质就是系统属性的集合.本篇主要介绍android中的style和theme的具体用法. styl ...
- jeesite3环境部署时初始化数据库注意问题
---恢复内容开始--- 首先要修改jeesite.properties下数据库连接方式,注意选择自己的数据库 其次在pom.xml文件中修改对应的数据库连接方式 最后运行db文件夹下的init-db ...
- P1005 Spell It Right
# P1005 Spell It Right 原题 Given a non-negative integer N, your task is to compute the sum of all the ...
- OSI参考模型总结
OSI(Open System Interconnect),即开放式系统互联. 一般都叫OSI参考模型,是ISO(国际标准化组织)组织在1985年研究的网络互连模型.下面我们将一层一层的看OSI协议. ...
- Fundebug网站升级HTTP/2,真的变快了!
作为新一代的HTTP协议,HTTP/2可以提高网站性能,优化用户体验,Fundebug也是时候升级HTTP/2了,虽然已经有点晚了. 升级HTTP/2是一件很简单的事情,改1行Nginx配置就好了,但 ...
- [日常] ubuntu下安装php pdo扩展和导入数据库
默认安装的php不存在pdo扩展,因此在使用到的时候会报错,直接使用这个命令 apt-get install php-mysql 就可以成功安装pdo扩展 安装完数据库后需要导入sql语句,先进入数据 ...
- js中新增的Symbol
在ES6之前,js的的基本数据类型有String Number Null Boolean undefined Object6中数据类型,Symbol是一种新增加的基本数据类型 特性 Symbol 不需 ...