Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications

|

How to Impersonate in Microsoft Dynamics CRM

Post Author: Joe D365 |

When utilizing CRM Portals for Microsoft Dynamics CRM, there are many things you will consider as you begin to implement. How you connect to Dynamics CRM is one of those important decisions.

In most typical portal implementations, a service account is used to connect to CRM.  This is the account that reads and writes all needed data to CRM.  This also means that when any record is created or updated through the portal, the records gets stamped with this service account user.  This is typically ok, but there are some cases where we do not want the record being created with the service account user name but with a specific CRM user.

For example, one scenario may be where we are creating opportunities via a portal.  In such a case, perhaps in addition to being owned by a sales person, we want the created by to also reflect this sales person.

This can be achieved by using impersonation.  There are the two steps needed to impersonate in Microsoft Dynamics CRM:

  • The user (impersonator) must have the ActOnBehalfOf privilege or be a member of the PrivUserGroup group in Active Directory
  • Setting the CallerId property of the organization Web service proxy. Please find below a sample code that shows how to set the caller id of the organization service proxy

Impersonate in Microsoft Dynamics Crm

Note: the SystemUser is custom class we created for accessing system user entity fields in crm and CrmService is another custom class we created for creating an instance of organization service proxy

Happy CRM'ing!

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

PowerObjects Recommends