Js 查询实体值示例
来源:互联网 发布:方框图用什么软件 编辑:程序博客网 时间:2024/06/03 17:49
var name=GetEntityAttributeByAttribute("account","name","accountid",new_accountid);
var new_shippingmethodid=GetEntityAttributeByAttribute("account","new_shippingmethodid","accountid",new_accountid);
var new_ShipName=GetEntityAttributeByAttribute("new_shippingmethod","new_name","new_shippingmethodid",new_shippingmethodid);
if (new_ShipName=="Sea Transport" && crmForm.all.new_destinationportid.DataValue==null)
{
alert("运输方式为Sea transport时目的港不能为空!") ;
event.returnValue = false;
}
function GetEntityAttributeByAttribute(EntityName,RetrieveAttributeName,ConditionAttributeName,ConditionAttributeNameValue)
{
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
GenerateAuthenticationHeader()+
" <soap:Body>" +
" <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
" <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
" <q1:EntityName>"+EntityName+"</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>"+RetrieveAttributeName+"</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:PageInfo>" +
" <q1:PageNumber>1</q1:PageNumber>" +
" <q1:Count>50</q1:Count>" +
" </q1:PageInfo>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>"+ConditionAttributeName+"</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">"+ConditionAttributeNameValue+"</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>" +
"";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
var oXml = new ActiveXObject("Msxml2.DOMDocument");
oXml.loadXML(resultXml.xml);
var roleList= oXml.selectNodes("//BusinessEntity/q1:"+RetrieveAttributeName);
var returnValue="";
if(roleList.length>0)
{
returnValue=roleList[0].text;
}
return returnValue;
}
- Js 查询实体值示例
- js解析json读取List中的实体对象示例
- js解析json读取List中的实体对象示例
- 实体层示例
- javaweb srpingmvc mybatis 分页查询 增加示例 参数类型map 和实体对象
- HQL实体对象查询
- Hibernate查询实体对象
- JPQL多实体查询
- JPA查询实体属性
- ofbiz实体 查询
- sku组合查询算法探讨-之JS实现示例
- 文本框输入值进行实体多属性查询
- js 处理实体字符串
- 转化实体--JS
- 利用C#实体克隆一个js实体
- 4.hql查询实体:测试
- 5.hql查询实体:总结
- 用HQL进行实体查询
- SAP-批量修改主数据-mass
- 一种新的 Web 服务器推送技术 - comet
- 类似google的可拖动div层网页布局,支持firefox,样式可自定义
- inner join从三个表中查询数据
- 最老程序员创业札记:全文检索、数据挖掘、推荐引擎应用3
- Js 查询实体值示例
- 19. A fox may grow gray, but never good. 江山易改,本性难易
- http://www.moncleronlinemarts.com/2011/04/linux-rsync1/
- 理解 Delphi 的类(一) - 从结构谈起
- 理解 Delphi 的类(二) - 初识类的方法
- 1721 Stone2
- Linq to SQL 技术贴汇总
- 二小时与四周时间在编程上的差别
- 理解 Delphi 的类(三) - 初识类的属性