简体   繁体   English

从Dynamics CRM 4中的“自定义工作流”获取呼叫用户ID

[英]Get calling UserID from Custom Workflow in Dynamics CRM 4

I want to get the UserID of the current user from whom the Workflow was executed in Dynamics CRM 4. 我想获取在Dynamics CRM 4中从中执行工作流的当前用户的UserID。

I did it using the 我是用

IWorkflowContext.UserID

but it gets the ID of the Workflow Owner. 但它获取工作流程所有者的ID。

There is no way to retrieve this information unless a user explicitly ran the workflow "on demand." 除非用户明确“按需”运行工作流,否则无法检索此信息。 If the workflow was triggered via a crm action (such as create of a record) it will run under the context of the workflow owner. 如果工作流程是通过crm操作(例如创建记录)触发的,则它将在工作流程所有者的上下文中运行。

See this blog post from a member of the crm support team: 请参阅crm支持小组成员的博客文章

UserId: If the workflow was executed on demand, this will be the ID of the user who executed the workflow. UserId:如果工作流按需执行,则将是执行工作流的用户的ID。 If the workflow was executed due to a message executing, then it will be the ID of the workflow owner. 如果工作流是由于执行消息而执行的,则它将是工作流所有者的ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM