Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Plugin Step - Run in User's Context - User Not Found

Posted on by 380

Hi everyone.  Suppose you have a plugin registered to run in a specific user's context, say as a system admin.  If you deploy the plugin, and the specified user is not found, does the plugin revert to running as the current user?  In my experience, the plugin always changes to run as the user who is deploying the solution.  But lately, maybe as of 9.0 or 9.0.2, the plugin steps are reverting to running as the current user.  Am I crazy or is this behavior specific to CRM Online or managed solutions?  What's worse, is that subsequent deployments keep resetting this, so we'll need to update every plugin step which uses impersonation after every deployment.  Is this causing anyone else issues?  This is in CRM Online, 9.0.2. Thanks!  

*This post is locked for comments

  • Suggested answer
    Sid07 Profile Picture
    Sid07 285 on at
    RE: Plugin Step - Run in User's Context - User Not Found

    Hi,

    I have an alternate idea for this. Let the user be any user or run under calling user the code where u r creating IOrganizationService i.e where u pass context.UserId or context.InitiatingUserId simply pass Guide.Empty then the service will be created under SYSTEM user. Then no need to think about system admin present or not in the system..

    Hope this helps.

  • Suggested answer
    Hussein Wahba Profile Picture
    Hussein Wahba 223 on at
    RE: Plugin Step - Run in User's Context - User Not Found

    Actually what I see starting from MS Dynamics 2015 that deploying a step runs with a specific user is changed to run as current user.

    But if you want to avoid this issue, you can run the step as a specific user which named "System (Disabled)" this user has admin privilege and can do anything as admin except sending emails.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans