crm使用soap删除下拉框
//C# 代码:
//DeleteOptionSetRequest request = new DeleteOptionSetRequest();
//request.Name = "new_year";
//DeleteOptionSetResponse response = (DeleteOptionSetResponse)service.Execute(request);
//js样例
function demo() {
//属性名称
var attrName = "new_year";
deleteOption(attrName);
}
function deleteOption(attrName) {
var request = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>";
request += "<s:Body>";
request += "<Execute xmlns='http://schemas.microsoft.com/xrm/2011/Contracts/Services' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>";
request += "<request i:type='a:DeleteOptionSetRequest' xmlns:a='http://schemas.microsoft.com/xrm/2011/Contracts'>";
request += "<a:Parameters xmlns:b='http://schemas.datacontract.org/2004/07/System.Collections.Generic'>";
request += "<a:KeyValuePairOfstringanyType>";
request += "<b:key>Name</b:key>";
request += "<b:value i:type='c:string' xmlns:c='http://www.w3.org/2001/XMLSchema'>"+ attrName +"</b:value>";
request += "</a:KeyValuePairOfstringanyType>";
request += "</a:Parameters>";
request += "<a:RequestId i:nil='true' />";
request += "<a:RequestName>DeleteOptionSet</a:RequestName>";
request += "</request>";
request += "</Execute>";
request += "</s:Body>";
request += "</s:Envelope>";
execSoap(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更改下拉框的文本值
//C#代码 //UpdateStateValueRequest updateStateValue = new UpdateStateValueRequest //{ // AttributeL ...
- crm使用soap创建下拉框
//C#代码 //#region OptionMetadataCollection //OptionMetadataCollection opCollection = new OptionMetada ...
- crm使用soap插入下拉框选项
//C# 代码: //InsertOptionValueRequest request = new InsertOptionValueRequest(); //request.OptionSetNam ...
- JavaScript向select下拉框中加入和删除元素
JavaScript向select下拉框中加入和删除元素 1.说明 a 利用append()方法向下拉框中加入元素 b 利用remove()方法移除下拉框中最后一个元素 2.设计源代码 < ...
- JavaScript向select下拉框中添加和删除元素
JavaScript向select下拉框中添加和删除元素 1.说明 a 利用append()方法向下拉框中添加元素 b 利用remove()方法移除下拉框中最后一个元素 2.设计源码 < ...
- JQuery打造下拉框联动效果
做联动效果,若是用纯JavaScript来做,往往须要辅助页面保存须要刷新的结果集,然后渲染到原页面.考虑将须要动态刷新的内容自己主动拼接到前一个下拉框之后,当前一个下拉框onchange后,同级的后 ...
- jQuery 动态加载下拉框选项(Django)
function change_style() { $.ajax({ url: "{% url 'change_style' %}", type: "GET", ...
- Web 1三级联动 下拉框 2添加修改删除 弹框
Web 三级联动 下拉框 using System; using System.Collections.Generic; using System.Linq; using System.Web; u ...
- jquery操作select下拉框:取值,赋值,删除
1.jQuery对select的取值 <select id="test"> <option value ="1">测试1</opt ...
随机推荐
- 使用 隧道技术 使用http代理连接 svn:// git://
问题点 在某些情况下 无法通过代理 用 svn 访问svn://协议例如(svn://www.qdac.cc ) 故此有了此贴 远端需要一个代理 服务器 connect-tunnel -P 代理 ...
- 5.1 qbxt 一测 T2
求和[问题描述] 组合数 C(n,m)是从 n 个物品中取 m 个的方案数. C(n,m)=(n!)/(m!(n-m)!) 斐波那契数列 F 满足,F[0]=F[1]=1,n≥2 时 F[n]=F[n ...
- 用户管理命令--useradd
用户管理命令--useradd 作用:用于添加一个新的用户 格式:useradd [ 选项 ] 用户名 选项的常用介绍 -u: UID指定用户id,必须是唯一的,并且大于499 -c: 添加注释,可以 ...
- 2. 更改InnoDB redo日志文件的数量或大小
2. 更改InnoDB redo日志文件的数量或大小 要更改InnoDB 重做日志文件的数量或大小,请执行以下步骤: 1)停止MySQL服务器,确保正常关闭且没有错误发生 2) 编辑my.cnf以更改 ...
- 【Linux】Centos6的iptables防火墙设置
1,查看防火墙状态 # service iptables status //或 # /etc/init.d/iptables status 2,防火墙的启动.重启,关闭 # service iptab ...
- CSS3---媒体查询与响应式布局
1. 值 设备类型 All 所有设备 Braille 盲人用点字法触觉回馈设备 Embossed 盲文打印机 Handheld 便携设备 Print 打印用纸或打印预览视图 Projection 各种 ...
- 条款21:必须返回对象时,别妄想返回其reference(Don't try to return a reference when you must return an object)
NOTE: 1.绝不要返回pointer或reference 指向一个local stack 对象,或返回reference 指向一个heap-allocated对象,或返回pointer 或refe ...
- Java:post请求
文章来源:https://www.cnblogs.com/hello-tl/p/9140870.html 0.post请求返回json import java.io.BufferedInputStre ...
- Golang 编写 Tcp 服务器
Golang 作为广泛用于服务端和云计算领域的编程语言,tcp socket 是其中至关重要的功能.无论是 WEB 服务器还是各类中间件都离不开 tcp socket 的支持. Echo 服务器 拆包 ...
- 【03】使用 Firebug 调试 JavaScript
[03] 使用 Firebug 调试 JavaScript 描述 Firebug是一个非常强大的工具,可以帮助您发现代码发现错误的错误并解决错误. 在此我们使用Firebug来处理Javascript ...