web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Run Workflow as Owner of Workflow

(0) ShareShare
ReportReport
Posted on by 90

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?

I have the same question (0)
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    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

  • Monty_270311 Profile Picture
    90 on at

    Hi,

    So you can't capture triggering user in a custom workflow or plugin?

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Hello,

    Can you make your workflow as the Real Time and make below change in the workflow.

    pastedimage1652441741035v1.png

    Thank you,

    Amit Katariya

  • Monty_270311 Profile Picture
    90 on at

    "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."

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    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.

    https://crmchap.co.uk/determining-the-initiating-user-details-on-a-c-plug-in-dynamics-365-for-customer-engagement/

    https://www.inkeysolutions.com/blogs/execute-a-plugin-in-the-context-of-the-logged-in-user-or-calling-user-or-system-user-in-microsoft-dynamics-365/

    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)

    Change Createdby/Modifiedby Field at Runtime in Dynamics CRM Plugin | Microsoft Dynamics 365 CRM Tips and Tricks (inogic.com)

    Thank you,

    Amit Katariya

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans