![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioaAMwim_u84ePh0EFecYDS-EmNOBtmYO0mgRR65Rt3Bl97wtM4HngdA_DKfhy5FvqlLbkFP6ftz_aIOw4UVgaNKpUZNQ7E_CGH__BabeHjvlH2j6EjIvygX7aneHKOImMbUN5Qw41G71M/s320/05042008721.jpg)
Hi I found on the net a blog with tutorials to learn patcwork.Espero to serve you for that begin with the patchwork. Click on the link below:
Http://quieroaprenderpatchwork.blogspot.com /
client
nroRegistros var;
var authenticationHeader;
var xml;
if (crmForm.FormType == 1) {
if (crmForm.all.jlc_documentoaccountid.DataValue[0].id != null 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'>" +
authenticationHeader +
"<soap:Body>" +
"<Fetch xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
"<fetchXml>&lt;fetch mapping='logical'&gt;" +
"&lt;entity name='jlc_documento'&gt;" +
"&lt;filter type='or'&gt;" +
"&lt;condition attribute='jlc_documentoaccountid' operator='eq' value='" + clienteId + "'/&gt;" +
"&lt;condition attribute='jlc_documentocontactid' operator='eq' value='" + clienteId + "'/&gt;" +
"&lt;/filter&gt;" +
"&lt;/entity&gt;" +
"&lt;/fetch&gt;</fetchXml>" +
"</Fetch>" +
"</soap:Body>" +
"</soap:Envelope>";
//Prepare the xmlHttpObject and send the request.
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Fetch");
xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xHReq.setRequestHeader("Content-Length", xml.length);
xHReq.send(xml);
//Capture the result was
resultXml = xHReq.responseXML;
/ / Check for errors.
was errorCount = resultXml.selectNodes ('/ / error'). Length;
if (errorCount! = 0) {msg =
was resultXml.selectSingleNode ('/ / description'). NodeTypedValue;
alert (msg);
} / / Process and display the results.
else {
/ / Capture the result og UnEncode IT.
was ResultSet = new String ();
ResultSet = resultXml.text;
resultSet.replace ('<','\u0026lt;');
resultSet.replace ('>', '>');
/ / Create an XML document That you-can parse.
was oXmlDoc = new ActiveXObject ("Microsoft.XMLDOM");
oXmlDoc.async = false;
/ / Load the XML document That speed the UnEncoded results.
oXmlDoc.loadXML (ResultSet);
/ / Display the results.
was oXmlDoc.getElementsByTagName results = ('result');
nroRegistros = results.length;
if (nroRegistros == 10) {
alert ("Make sure he registrado el número Máximo de Asociaciones");
window.close () ;}
}}}
CORRECT SOLUTION