In this blog, we highlight a lesson learned when we used a Dynamics 365 Customer Engagement online data source connector, called Instance Web API, for Power BI reports.
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:
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