crm2011 使用SOAP 查询单个记录 Retrieve

function getServiceUrl() {

var serverUrl = Xrm.Page.context.getServerUrl();

if (serverUrl.match(/\/$/)) {

serverUrl = serverUrl.substring(0, serverUrl.length - 1);

}

return serverUrl + "/XRMServices/2011/Organization.svc/web";

}

function Retrieve(entityName,entityId) {

var request = "<s:Envelope xmlns:s=‘http://schemas.xmlsoap.org/soap/envelope/‘>"

request += "<s:Body>"

request += "<Retrieve xmlns=‘http://schemas.microsoft.com/xrm/2011/Contracts/Services‘ xmlns:i=‘http://www.w3.org/2001/XMLSchema-instance‘>"

request += "<entityName>‘"+ entityName +"‘</entityName>"

request += "<id>‘"+ entityId +"‘</id>"

request += "<columnSet xmlns:a=‘http://schemas.microsoft.com/xrm/2011/Contracts‘>"

request += "<a:AllColumns>true</a:AllColumns>"

request += "<a:Columns xmlns:b=‘http://schemas.microsoft.com/2003/10/Serialization/Arrays‘ />"

request += "</columnSet>"

request += "</Retrieve>"

request += "</s:Body>"

request += "</s:Envelope>";

var xmlAjax = new XMLHttpRequest();

xmlAjax.open("POST", getServiceUrl(), true);

xmlAjax.setRequestHeader("Accept", "application/xml, text/xml, */*");

xmlAjax.setRequestHeader("Content-Type", "text/xml; charset=utf-8");

xmlAjax.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Retrieve");

xmlAjax.onreadystatechange = function() {

execresult(xmlAjax);

};

xmlAjax.send(request);

}

function execresult(ajax) {

if (ajax.readyState == 4) {

if (ajax.status == 200) {

alert(ajax.responseXML);

}

}

}

crm2011 使用SOAP 查询单个记录 Retrieve,布布扣,bubuko.com

时间: 2024-08-24 11:06:54

crm2011 使用SOAP 查询单个记录 Retrieve的相关文章

crm2011查询审核记录

using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; /// <summary> /// 查询审核记录 /// </summary> public class RetrieveRecordChangeHistoryRequestHelper { public void Retrieve(IOrganizationService service,string entityName,Guid i

hibernate里联合主键composite-id映射,查询单个主键的问题

今天项目中遇到这个问题,搞了大半天,现在记录下来hibernate里联合主键配置(多个字段一起作为主键) <class name="com.cskj.hibernate.map.BbWjjc" table="bb_wjjc" schema="dbo" catalog="wjgl"> <composite-id name="id" class="com.cskj.hibernate

sql查询重复记录的方法

1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people  where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2.查找表中多个字段的重复记录 select * from vitae a where (a.peopleId,a.seq) in (select peopleId,seq from vita

hibernate里联合主键composite-id映射,查询单个主键的问题(转)

今天项目中遇到这个问题,搞了大半天,我郁闷...hibernate里联合主键配置(多个字段一起作为主键) <class name="com.cskj.hibernate.map.BbWjjc" table="bb_wjjc" schema="dbo" catalog="wjgl">        <composite-id name="id" class="com.cskj.hi

C# winform窗体设计-查询单个值

查询单个值主要用于对成绩最低分,最高分,学生总数,学生性别等信息的统计 在查询单个值的时候用到了ExecuteScalar方法,连接以及语句方面,以及思路和对数据的增删改差不多 下面请看一段代码: string s = "server=.;database=SampleDb;Integrated Security=True"; SqlConnection c = new SqlConnection(s); c.Open(); SqlCommand command = new SqlCo

sql查询重复记录、删除重复记录方法大全

1.查询重复记录单字段 select * from tbl a where  exists(select 1 from  tbl b where a.username=b.username group by username  having count(*) > 1) 2.查询重复次数 select clistname,count(clistname) from clalist  group by clistname having count(*)>1 3.删除重复记录,留有rowid最小的记

Oracle查询当前记录的上一条记录或下一条记录

//查询当前记录的 //oracle 上一条记录select decode(decode(txbs,'无',null,txbs),lag(t.txbs, 1, 0) over(order by t.cjid),'是','否')from qb_app_rycj t //下一条记录select t.id, lead(t.id, 1, 0) over(order by t.sort,t.eidt_date) as p from cms_article t

Mssql 查询某记录前后N条

Sqlserver 查询指定记录前后N条,包括当前数据 条件 [ID] 查询 [N]条 select * from [Table] where ID in (select top ([N]+1) ID from [Table] where id <=[ID] order by id descunionselect top [N] ID from [Table] where id>[ID] order by id )order by ID 例如:有数据表 A id    name    date

mysql-关联查询sql记录

//查询账单关联订单 select o.id as id, o.order_no as orderNo, o.case_no as caseNo, o.send_time as sendTime, o.final_time as finalTime, (select ca.car_no from fm_order_case ca where ca.case_no = o.case_no) as carNo, (select co.service_money from fm_order_cost