积极答复者
Dynamics CRM 4.0中用JavaScript调用Workflow 的 执行权限问题

问题
-
我的工作流运行方式原来是按照状态改变触发的,发现只要更新记录就会触发,为了减少意外触发,我把工作流改成了按需运行。用下面的代码,但又有了新问题,生成工作流记录的负责人是当前登录者,但操作用户权限有限,工作流过程中就会失败。麻烦各位帮我看看如何才能使工作流记录的负责人是管理员?
CODE:原理就是用类似ajax的方法调用CRM服务器上的webservice。
/* the function */
ExecuteWorkflow = function(entityId, workflowId)
{
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<?xml:namespace prefix = soap />" +
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);
}
/* call */
var theWorkflowId = "3FD2DD58-4708-43D7-A21B-F0F90A0AA9F2"; //change to your workflow Id
ExecuteWorkflow(crmForm.ObjectId, theWorkflowId);
答案
全部回复
-
自动运行的工作流是Workflow的创建者;手动运行的就是当前用户的权限。
建议你配置一下用户的权限。
Jim
Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com, http://mscrm.cn -