I want to get the UserID of the current user from whom the Workflow was executed in Dynamics CRM 4.
I did it using the
IWorkflowContext.UserID
but it gets the ID of the Workflow Owner.
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.
See this blog post from a member of the crm support team:
UserId: If the workflow was executed on demand, this will be the ID of the user who executed the workflow. If the workflow was executed due to a message executing, then it will be the ID of the workflow owner.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.