Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try put this code in load event:</p> <pre><code> var xml = "" + "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" + "&lt;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\"&gt;" + GenerateAuthenticationHeader() + " &lt;soap:Body&gt;" + " &lt;RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\"&gt;" + " &lt;query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\"&gt;" + " &lt;q1:EntityName&gt;new_schools&lt;/q1:EntityName&gt;" + " &lt;q1:ColumnSet xsi:type=\"q1:ColumnSet\"&gt;" + " &lt;q1:Attributes&gt;" + " &lt;q1:Attribute&gt;new_schoolsid&lt;/q1:Attribute&gt;" + " &lt;/q1:Attributes&gt;" + " &lt;/q1:ColumnSet&gt;" + " &lt;q1:Distinct&gt;false&lt;/q1:Distinct&gt;" + " &lt;q1:Criteria&gt;" + " &lt;q1:FilterOperator&gt;And&lt;/q1:FilterOperator&gt;" + " &lt;q1:Conditions&gt;" + " &lt;q1:Condition&gt;" + " &lt;q1:AttributeName&gt;new_phonenumber&lt;/q1:AttributeName&gt;" + " &lt;q1:Operator&gt;Equal&lt;/q1:Operator&gt;" + " &lt;q1:Values&gt;" + " &lt;q1:Value xsi:type=\"xsd:string\"&gt;"+crmForm.all.new_phonenumber.DataValue+"&lt;/q1:Value&gt;" + " &lt;/q1:Values&gt;" + " &lt;/q1:Condition&gt;" + " &lt;/q1:Conditions&gt;" + " &lt;/q1:Criteria&gt;" + " &lt;/query&gt;" + " &lt;/RetrieveMultiple&gt;" + " &lt;/soap:Body&gt;" + "&lt;/soap:Envelope&gt;" + ""; var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP"); xmlHttpRequest.Open("POST", "http://"+window.location.hostname+":"+window.location.port+"/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; if (_resultXml.xml.search('&lt;q1:new_schoolsid')&gt;0) { var val = xmlDoc.getElementsByTagName("q1:new_schoolsid")[0].childNodes[0].nodeValue; var lookupitem = new Array(); lookupitem[0] = new LookupControlItem(val , typecode, name); crmForm.all.schoolLookupid.DataValue = lookupitem ; } } </code></pre> <p>I don't try this code be careful. Use this code as a guide.</p> <p>Hope this helps. If i answered your question, please mark the response as an answer and also vote as helpful.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload