|Note: The content in this article is specific to Microsoft Dynamics CRM 4 only.|
To enable Service Accounts to own entities within CRM, impersonation can be configured using the WEB Services. Once this has been configured the service account; which is the logged on user and the logged on user owns the identities, would be able to manipulate entities specifically for the default views for example My Tasks and My Leads.
Before the K2 Service Account can be given ownership of entities within Microsoft CRM, preliminary steps must first be completed within Active Directory. The steps below must be followed first and are a prerequisite before configuring Microsoft CRM.
The CRM Impersonation feature requires the logged on user to be a member of the PrivUserGroup in Active Directory and a GUID is used to identify the user in the User Entity. See below on how to configure this:
The GUID has already been generated from within Microsoft CRM and can be located in one of three places. See the steps below to locate the GUID via:
• Microsoft CRM User Interface
• K2 SmartObjects
• K2 SmartObjects from within the K2 Designers
Microsoft CRM User Interface
Options available to retrieve the GUID
To retrieve the GUID using K2 SmartObjects perform the steps below:
1. Register an Instance of the CRM Entity broker
2. Create a SmartObject against the User entity
3. Perform a Get List call against the CRM User SmartObject
4. The User column contains the GUID that you need
SmartObjects in the K2 Designer
To retrieve the GUID using SmartObjects from within the K2 Designer:
1. Use your CRM User SmartObject and do a filtered list
2. Pass in the FQN of a user to the Domain Logon Name field – make sure you trim out the label prefix.
3. Use other filter values if you need
4. Store the User value for later use
|Note: The example below requires that the aforementioned steps be completed first before attempting it.|
In this example a new Task entity will be created for each destination user
|Important: Note: Not all steps are provided|
Create the CRM Task
Replace it with:
Caution: Do not replace the creation of the service on line 284 for Create or 596 for modify. This instance of the service is used to retrieve systems values for other elements of the wizard which the impersonating user may not have permission to access.
To finalize, if the requirement is to modify or create entities in Microsoft CRM as a user other than the K2 Service account then it is possible with just a few minor changes to the event wizard code to facilitate this. The advantage is that impersonation uses a standard feature of Microsoft CRM and does not require username and password i.e. credentials to be specified.