crm使用soap启用和停用记录
function demo() {
//操作记录的id
var targetId = "a8a46444-ba10-e411-8a04-00155d002f02";
//操作记录的实体名称
var targetType = "new_config";
//启用
SetState(targetId, targetType, 1, 2);
//停用
SetState(targetId, targetType, 0, 1);
}
function SetState(targetId,targetType,state,status) {
var request = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>" +
"<s:Body>" +
"<Execute xmlns='http://schemas.microsoft.com/xrm/2011/Contracts/Services' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>" +
"<request i:type='b:SetStateRequest' xmlns:a='http://schemas.microsoft.com/xrm/2011/Contracts' xmlns:b='http://schemas.microsoft.com/crm/2011/Contracts'>" +
"<a:Parameters xmlns:c='http://schemas.datacontract.org/2004/07/System.Collections.Generic'>" +
"<a:KeyValuePairOfstringanyType>" +
"<c:key>EntityMoniker</c:key>" +
"<c:value i:type='a:EntityReference'>" +
"<a:Id>" + targetId + "</a:Id>" +
"<a:LogicalName>"+ targetType +"</a:LogicalName>" +
"<a:Name i:nil='true' />" +
"</c:value>" +
"</a:KeyValuePairOfstringanyType>" +
"<a:KeyValuePairOfstringanyType>" +
"<c:key>State</c:key>" +
"<c:value i:type='a:OptionSetValue'>" +
"<a:Value>" + state + "</a:Value>" +
"</c:value>" +
"</a:KeyValuePairOfstringanyType>" +
"<a:KeyValuePairOfstringanyType>" +
"<c:key>Status</c:key>" +
"<c:value i:type='a:OptionSetValue'>" +
"<a:Value>"+ status +"</a:Value>" +
"</c:value>" +
"</a:KeyValuePairOfstringanyType>" +
"</a:Parameters>" +
"<a:RequestId i:nil='true' />" +
"<a:RequestName>SetState</a:RequestName>" +
"</request>" +
"</Execute>" +
"</s:Body>";
"</s:Envelope>";
getWebUrl(request);
}
//获取服务地址
function getWebUrl() {
var serverUrl = Xrm.Page.context.getServerUrl();
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
}
return serverUrl + "/XRMServices/2011/Organization.svc/web";
}
//运行请求
function execSoap(request) {
var ajaxRequest = new XMLHttpRequest();
ajaxRequest.open("POST", getWebUrl(), true)
ajaxRequest.setRequestHeader("Accept", "application/xml, text/xml, */*");
ajaxRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
ajaxRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
ajaxRequest.send(request);
}
crm使用soap启用和停用记录的更多相关文章
- crm使用soap取消用户訪问记录权限
//取消訪问权限 function demo() { //操作记录的id var targetId = "A8A46444-BA10-E411-8A04-00155D002F ...
- 我是如何将网站全站启用Https的?-记录博客安装配置SSL证书全过程
评论» 文章目录 为什么要Https 如何选择Https 安装部署SSL证书 平滑过渡Https 搜索引擎的响应 启用Https小结 正如大家所看到的,部落全站已经启用了Https访问了,连续几天 ...
- MacBook 启用或停用 root 用户
启用或停用 root 用户 选取苹果菜单 () >“系统偏好设置”,然后点按“用户与群组”(或“帐户”). 点按 ,然后输入管理员名称和密码. 点按“登录选项”. 点按“加入”(或“编辑”). ...
- crm使用soap分配记录
//样例 function demo() { //操作记录的id var targetId = "A8A46444-BA10-E411-8A04-00155D002F02&q ...
- crm采用soap删除记录
//抽样 function demo() { //操作记录id var targetId = "A8A46444-BA10-E411-8A04-00155D002F02&qu ...
- Oracle约束的启用和停用
关于Oracle的约束概念和基本操作,我已经在以前的<Constraint基础概念>.<Constraint的简单操作>两篇文章中有过比较详细的介绍了,但是对于如何停用和启 ...
- Dynamics CRM 通过PowerShell启用AllowDeclarativeWorkflows即自定义XAML WorkFlows
CRM的工作流即workflow,不了解的人乍听之下以为是审批流,其实不是的,CRM本身是不带审批功能的,要实现审批必须要第三方的工作流引擎的配合,当然你也可以自己开发. 工作流刚开始出现的时候只有异 ...
- linux ftp启用和停用及vsftpd安装 ssh 启用和停用命令及ssh的安装
1.首页要用ftp:服务器上必须安装vsftpd 安装命令 yum installed vsftpd 查看vsftpd是否启动 root@DK:/home/daokr# service vsftpd ...
- crm使用soap更改下拉框的文本值
//C#代码 //UpdateStateValueRequest updateStateValue = new UpdateStateValueRequest //{ // AttributeL ...
随机推荐
- hbuilder中的 http://www.w3.org/TR/html4/strict.dtd
<!-- This is HTML 4.01 Strict DTD, which excludes the presentation attributes and elements that W ...
- C与C艹的内存管理方式
C 内存开辟出的空间一般可以分成:代码段,数据段(初始化的数据段, 为初始化的数据段BSS),堆,栈 代码段:保存程序文本,指令指针EIP就是指向代码段,可读可执行不可写 数据段:保存初始化的全局变量 ...
- jQuery使用手册,【新手必备】
jQuery是一款同prototype一样优秀js开发库类,特别是对css和XPath的支持,使我们写js变得更加方便!如果你不是个js高手又想写出优 秀的js效果,jQuery可以帮你达到目的! ...
- iOS CoreData 开发之数据模型关系
接着上一篇,上一篇中,我们简单的实现了一个用户实体,本次添加一个用户信息实体,与用户实体相关联,关系为1:1. 新建一个实体UserInfo:
- SQL基本操作——日期函数
SQL日期:当我们处理日期时,最难的任务恐怕是确保所插入的日期的格式,与数据库中日期列的格式相匹配.只要数据包含的只是日期部分,运行查询就不会出问题.但是,如果涉及时间,情况就有点复杂了.在讨论日期查 ...
- oracle sql*loader的使用
用法: SQLLDR keyword=value [,keyword=value,...] 有效的关键字: userid -- ORACLE 用户名/口令 control -- 控制文件 ...
- 【译】x86程序员手册15-5.2页转换
5.2 Page Translation 页转换 In the second phase of address transformation, the 80386 transforms a linea ...
- HDU_1542_线段树【扫描线】
Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...
- 如何在linux搭建airtest+chromeweb测试环境--(用命令行运行.air脚本)
大前堤: 如果你需要airtest提供的可视化测试报告,那你的操作系统,一定要有图形化界面. 否则运行你的airtest脚本 会遇到这样的问题 Xlib.error.DisplayNameError: ...
- Java程序员怎么不断进阶 必须要掌握哪些技能
Java程序员怎么不断进阶?必须要掌握哪些技能?成为架构师是Java程序员职业规划中的重要一环,但如何才能快速实现进阶困扰了许多Java程序员.无论是从技能深度还是实战经验,架构师都远超于普通的Jav ...