/* the function */
ExecuteWorkflow = function(entityId, workflowId)
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
" <soap:Body>" +
" <Execute xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\
" <Request xsi:type=\"ExecuteWorkflow
" <EntityId>" + entityId + "</EntityId>" +
" <WorkflowId>" + workflowId + "</WorkflowId>" +
" </Request>" +
" </Execute>" +
" </soap:Body>" +
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLH
, "text/xml; charset=utf-8");
var resultXml = xmlHttpRequest.responseXML
/* call */
var theWorkflowId = "<my workflow id>
"; //change to your workflow Id
I am the owner of the workflow and have the top level security role with full rights to everything.
The workflow is set to run 'On Demand', the scope is set to organisation.
I have tried testing this code in the onChange event of a text box and in the onClick function of a button on the form.
I have tried using the workflow id of other workflows I know are working.
....and still nothing.
Can anybody think of some step that I'm missing or some way of debugging the code to see what the problem is.
The only thing that I can see that is out of the ordinary is that the workflow has multiple entries in [dlrcc_MSCRM].[dbo].[workf
lowbase] whereas other workflows just have one. I have tried each workflowid listed against it.