• Microsoft Dynamics CRM 4.0 用javascript 获取当前用户


    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=\"WhoAmIRequest\" />" + 
    "    </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;
    var userID=resultXml.getElementsByTagName("UserId")[0].childNodes[0].nodeValue;
    
    crmForm.all.new_ddwc.DataValue=userID;
    
  • 相关阅读:
    linux相关的常用站点
    基于命令行的网络调试和测试工具
    清除DNS缓存
    数组映射
    react-native 自定义多选
    weex 长按图片保存
    MySql常用总结
    git常用命令
    react-native 自制多选功能
    react-native setState无法保持更新
  • 原文地址:https://www.cnblogs.com/hellohongfu/p/1739656.html
Copyright © 2020-2023  润新知