zoukankan      html  css  js  c++  java
  • 主要料号只能显示某价目表的内容 Version1

    一个客户的需求. 主要实现的功能有:

    1.execute TargetRetriveDynamic 

    2.自定义lookupsingle.aspx

    function getpricelevelid(quoteidvalue)
    {
        
    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>" + 
    "    <Execute xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" + 
    "      <Request xsi:type=\"RetrieveRequest\" ReturnDynamicEntities=\"true\">" + 
    "        <Target xsi:type=\"TargetRetrieveDynamic\">" + 
    "          <EntityName>quote</EntityName>" + 
    "          <EntityId>"+quoteidvalue+"</EntityId>" + 
    "        </Target>" + 
    "        <ColumnSet xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:ColumnSet\">" + 
    "          <q1:Attributes>" + 
    "            <q1:Attribute>quoteid</q1:Attribute>" + 
    "            <q1:Attribute>pricelevelid</q1:Attribute>" + 
    "          </q1:Attributes>" + 
    "        </ColumnSet>" + 

    "      </Request>" + 
    "    </Execute>" + 
    "  </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/Execute");
    xmlHttpRequest.setRequestHeader(
    "Content-Type""text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader(
    "Content-Length", xml.length);
    xmlHttpRequest.send(xml);

    var resultXml = xmlHttpRequest.responseXML;

    // Create an XML object to parse the results.
    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async
    =false;
    xmlDoc.loadXML(resultXml.xml);

    var ret=xmlDoc.selectSingleNode("//Property[@Name='pricelevelid']");

    //ret.text enough for return xml;
    //
    in other case this may not enough be careful for this.
    return ret.text;

        

    //return  xmlDoc.getElementsByTagName("pricelevelid")[0].childNodes[0].nodeValue;


    }
    function OnCrmPageLoad()
    {
      
    var quoteidvalue =crmForm.all.quoteid.DataValue;

    if (crmForm.all.isproductoverridden.DataValue == 1)
     {
       crmForm.all.esp_productnumber.Disabled
    =false;
     }
    else
     {
       crmForm.all.esp_productnumber.Disabled
    =true;
       crmForm.all.esp_productnumber.ForceSubmit
    =true;

     }
        
    var productidLookup=crmForm.all.productid;

       
    var filterfetchxml="<fetch mapping='logical'><entity name='product'>"
        
    + "<filter type='or'><condition attribute='pricelevelid' operator='eq' value='"
        
    + getpricelevelid(quoteidvalue)    + "' /><condition attribute='pricelevelid' operator='eq' value='9439FF4D-8613-DE11-B063-001EC9B6EAFD' /> </filter></entity></fetch>";
       productidLookup.AddParam(
    "search",filterfetchxml);

        
    }

    OnCrmPageLoad();
  • 相关阅读:
    怎样评价聚类结果好坏?
    libsvm 用在 婚介数据集中 预测 用户配对
    mac 常用操作
    mac 安装 tomcat 配置
    mac 安装 maven 配置
    mac 安装 java 配置
    mac 安装 photoshop CS6
    mac 应用程序安装目录
    JavaScript、ES5和ES6的介绍和区别
    css 两列自适应布局的4种思路
  • 原文地址:https://www.cnblogs.com/janmson/p/1433674.html
Copyright © 2011-2022 走看看