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 :

D365 v9.x Quick Tip: How to run a Plugin in System User Context?

Mihir Maruti Kadam Profile Picture Mihir Maruti Kadam 702

Introduction

Sometimes, we want to run plugin in System user context to skip the unnecessary security checks.

In this blog, we will see how to Impersonate plugin to run in System User Context.

Prerequisites

  1. Basic knowledge of Dynamics 365 and Plugins

Click here to Learn Plugin’s .

Description

Pass Null to CreateOrganizationService Object instated of “context.UserId” and keep Run in User’s Context to Calling User.

Do not set Run in User’s Context to System (Disabled) from Plugin Registration tool because when the solution is Migrated to another environment, it will not work because of the User Id is different.

So it is recommend to Impersonate user from C# Plugin Code

Cheers !!!! I hope this will save your time

Reference

https://community.dynamics.com/crm/b/crmbusiness/archive/2015/07/21/crm-2015-understanding-impersonation-in-plugins-and-knowing-when-to-use-it


This was originally posted here.

Comments

*This post is locked for comments