Browsing all articles from November, 2011
CRM 2011 Set State to a Record
Código Jscript para Cambiar Estado a un Registro usando Jscript para CRM 2011:
1: function SetState(EntityName,Id,State,Status)
2: {
3: var authenticationHeader = GenerateAuthenticationHeader();
4: // Prepare the SOAP message.
5: var xml = "<?xml version='1.0' encoding='utf-8'?>" +
6:
7: "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
8: " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
9: authenticationHeader +
10: "<soap:Body>" +
11: "<Execute xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
12: "<Request xsi:type='SetStateDynamicEntityRequest'>" +
13: "<Entity>"+
14: "<Id xmlns='http://schemas.microsoft.com/crm/2006/CoreTypes'>"+Id+"</Id>" +
15: "<Name xmlns='http://schemas.microsoft.com/crm/2006/CoreTypes'>"+EntityName+"</Name>" +
16: "</Entity>" +
17: "<State>"+State+"</State>" +
18: "<Status>"+Status+"</Status>" +
19: "</Request>" +
20: "</Execute>" +
21: "</soap:Body>" +
22: "</soap:Envelope>";
23:
24: // Prepare the xmlHttpObject and send the request.
25: var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
26: xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
27: xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Execute");
28: xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
29: xHReq.setRequestHeader("Content-Length", xml.length);
30: xHReq.send(xml);
31: // Capture the result.
32: var resultXml = xHReq.responseXML;
33:
34: // Check for errors.
35: var errorCount = resultXml.selectNodes('//error').length;
36: if (errorCount != 0)
37: {
38: var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
39: alert(msg);
40: }
41: }
Archivo
- May 2012 (4)
- November 2011 (1)
- August 2011 (2)
- July 2011 (4)
- May 2011 (2)
- April 2011 (1)
- March 2011 (3)
- February 2011 (2)
- November 2010 (6)
- October 2010 (16)
- May 2010 (1)
- April 2010 (2)
- March 2010 (9)
- February 2010 (24)
Categorias
Add - Ons
Blog
CRM 2011
CRM Online
Herramientas de Implementación
Javascripts
Microsoft CRM
Noticias
Otras Cosas
Otras Tecnologías
Portafoilio
Reportes
Rollup
Scribe Insight
Sharepoint Foundation
Solución Problemas
Trucos
Uncategorized

Posted by cllamas in