Wednesday, December 02, 2009
« CRM LENTISSIMO!!! | Main | Errori di autenticazione »

...basta conoscere il comando SOAP.
La funzione javascript e' simile a quelle riportate nell'SDK per richiamare i metodi dei servizi web della platform.


ExecuteWorkflow = function(entityId, workflowId)
{
var xml = "" +
"" +
"" +
GenerateAuthenticationHeader() +
" " +
" " +
" " +
" " + entityId +
"
" +
" " + workflowId + "" +
"
" +
"
" +
"
" +
"
" +
"";

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;
return(resultXml.xml);
}
var theWorkflowId = "3FD2DD58-4708-43D7-A21B-F0F90A0AA9F2"; //da cambiare***
ExecuteWorkflow(crmForm.ObjectId, theWorkflowId);