![]() |
#3 |
Участник
|
Я попробовал зделать так, по логике должно работать, но почему то не работает... (вернее работает только для поля fullname)
var sEntityName="contact"; var sAttributeName="emailaddress1"; if (sGUID1 != null) { sXml = ""; sXml += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; sXml += "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\""; sXml += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""; sXml += " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"; sXml += "<soap:Body>"; sXml += "<entityName xmlns=\"http://schemas.microsoft.com/crm/2006/WebServices\">" +sEntityName + "</entityName>"; sXml += "<id xmlns=\"http://schemas.microsoft.com/crm/2006/WebServices\">" +sGUID1+ "</id>"; sXml += "<columnSet xmlns=\"http://schemas.microsoft.com/crm/2006/WebServices\""; sXml += " xmlns:q=\"http://schemas.microsoft.com/crm/2006/Query\""; sXml += " xsi:type=\"q:ColumnSet\"><q:Attributes><q:Attribute>" +sAttributeName + "</q:Attribute></q:Attributes></columnSet>"; sXml += "</soap:Body>"; sXml += "</soap:Envelope>"; oXmlHttp.Open("POST", serverurl +"/MsCrmServices/2006/CrmService.asmx",false); oXmlHttp.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/200...vices/Retrieve"); oXmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); oXmlHttp.setRequestHeader("Content-Length", sXml.length); oXmlHttp.send(sXml); var result = oXmlHttp.responseXML.selectSingleNode("//" + sAttributeName); if (result == null) { sassocfullmemvalue= "Нет данных"; } else { sassocfullmemvalue= result.text; } crmForm.all.new_emailkon.DataValue= sassocfullmemvalue; } Последний раз редактировалось tatra; 11.10.2007 в 14:16. |
|
|
|