Announcements
Hi,
I have a workflow that is run as the owner of the workflow when creating and completing Tasks. It needs to be run as the owner due to how it updates a closed Opportunity as well as completing the Task.
But, doing this sets the modifiedby or completed by fields to the owner of the workflow. Is it possible to capture the user instead of the owner?
As in:
User A completes the Task, the workflow runs, but then capture user A and append the user (systemuserid) to the modifiedby or completedby fields?
Any ideas?
Hello Monty,
This is the OOB workflow limitation.
As you are already in the right path you will just need to do some customization that create a plugin which will create Task after trigger and populate the owner as the calling user in the task.
refer below code where it is mentioned how we can get the Initiating user.
Then using below code you can set the created by and modified by in the plugin.
Override createdon, modifiedon, createdby, modifiedby in Dynamics 365/ CRM {CRM Tips from the Vault} - Debajit's Power Apps & Dynamics 365 Blog (debajmecrm.com)
Thank you,
Amit Katariya
"I have a workflow that is run as the owner of the workflow when creating and completing Tasks. It needs to be run as the owner due to how it updates a closed Opportunity as well as completing the Task."
Hello,
Can you make your workflow as the Real Time and make below change in the workflow.
Thank you,
Amit Katariya
Hi,
So you can't capture triggering user in a custom workflow or plugin?
Hello Monty,
It is not possible because workflow will run on behalf of triggering user.
Unless it will run in calling users context this will be not possible.
Thank you,
Amit Katariya
André Arnaud de Cal...
294,120
Super User 2025 Season 1
Martin Dráb
232,871
Most Valuable Professional
nmaenpaa
101,158
Moderator