zoukankan      html  css  js  c++  java
  • 20100518日做的订单存根

    if(IsNull(crmForm.all.new_nsrsbh)==false){
    //获取纳税人识别号
    var nsrsbh = crmForm.all.new_nsrsbh.DataValue;
    
    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>account</q1:EntityName>" + 
    "        <q1:ColumnSet xsi:type=\"q1:AllColumns\" />" + 
    "        <q1:Distinct>false</q1:Distinct>" + 
    "        <q1:Criteria>" + 
    "          <q1:FilterOperator>And</q1:FilterOperator>" + 
    "          <q1:Conditions>" + 
    "            <q1:Condition>" + 
    "              <q1:AttributeName>new_nsrsbh</q1:AttributeName>" + 
    "              <q1:Operator>Equal</q1:Operator>" + 
    "              <q1:Values>" + 
    "                <q1:Value xsi:type=\"xsd:string\">"+nsrsbh+"</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);
    
    try{
    var resultXml = xmlHttpRequest.responseXML;
    
    //企业名称
    var nsrmc = resultXml.getElementsByTagName("q1:name")[0].childNodes[0].nodeValue;
    
    var lookupData = new Array();
    // Create an object to add to the array.
       var lookupItem= new Object();
    // Set the id, typename, and name properties to the object.
         lookupItem.typename = 'account';
         lookupItem.name =nsrmc 
    // Add the object to the array.
       lookupData[0] = lookupItem;
    
    
    // Set the value of the lookup field to the value of the array.
       crmForm.all.customerid.DataValue = lookupData;
       crmForm.all.name.DataValue=nsrmc+"产品报订单";
    crmForm.all.customerid.disabled=true;
    crmForm.all.new_nsrsbh.disabled=true;
    }
    catch(Exception ){
     alert('纳税人信息查询不到');
    crmForm.all.new_nsrsbh.DataValue="";
    
     return;
    }
    
    
    
    
    }
    else{
     return;
    }
    
  • 相关阅读:
    kuangbin 专题一:G题,POJ3087:Shuffle'm Up
    kuangbin专题一:F题,POJ3126:Prime Path
    /*分治典型应用 快速排序*/
    kuangbin专题一 简单搜索 E,POJ 1426 Find The Multiple
    kuangbin专题一:C题,POJ3278:Catch That Cow
    kuangbin专题一B题:POJ2251:Dungeon Master
    kuangbin专题一A题 :POJ1321 :棋盘问题
    1282: ykc想吃好吃的
    2017年ACM第八届山东省赛I题: Parity check(判断 第n项斐波那契数列奇偶性)
    2017年ACM第八届山东省赛J题:company
  • 原文地址:https://www.cnblogs.com/hellohongfu/p/1739412.html
Copyright © 2011-2022 走看看