Category Archives: Code

CRM 2011: Reassign or Transfer Personal Views

Recently come across scenario where one of CRM user left the company and that user owned specific views which need to be transfer to his replacement CRM users.

These views created by old user using CRM advanced find screen and hence they are personal view of that user and as per CRM security settings even system administrator can not able to view and transfer this views to new user.

So I decided use impersonation to resolve this issue and created small standalone application for the same.

This application is shared below.
CRM2011_ReAssignViews_EXE

Following is few more details regarding this application for the same.

Step 1: after downloading, CRM2011_ReAssignViews_EXE.zip and extract the files.

Step 2: after extracting run the CRM2011_ReAssignViews_EXE.exe from extracted files.

Step 3: provide CRM server name, relevant port number, organization name and provide relevant credential for the same and then click on “Retrieve List of User” button.

For further steps and information please refer to following screen print for the same.

Note: – Please note that both users needs to active in CRM to perform above actions.

Hope this helps..

Cheers,
MayankP:)

Perform Action for 1:N and N:N Relationship in CRM 4.0 workflow editor

currently CRM 4.0 workflow editor allow you to update relevant record with N:1 relationship only, for example if you are in case screen then you can update related Account/Contact record only but if you want to update all tasks related to Case then you cannot able do it currently in Out of the box system.

Just came across this new project on codeplex which provides custom workflow which you can just register and this will extend (or add new action sub menu) in workflow editor screen to allow performing action for 1:N and N:N Relationship.

Following is the details from the CodePlex Site

Project Description
This plug-n allows to execute a workflow for each entity that has a 1:N or N:N relationship to a given entity.
For example: execute a workflow for each case related to an account (1:N), or for each competitor related to an opportunity (N:N), etc.

Summary
With CRM 4.0 out-of-the-box it is possible to perform actions on entities that have a N:1 relationship to a given entity, For example from an opportunity it is possible to update or run a workflow on the parent customer.

This plug-in allows to extend this to the other two possible relationships: 1:N and N:N. With the aid of this plugin it is possible to perform an action on each opportunity given the parent customer (1:N) or on each competitor given the opportunity (N:N) or on each opportunity given the competitor (other way of the same N:N).

Installation
Copy the .dll to the Microsoft Dynamics CRM\Server\bin\assembly folder
Run the Plug-in Registration tool and register the .dll
If the plug-in was registered successfully, a new action sub-menu (Utilities) will be available when selecting a workflow action.

Download Project documentation and files : http://crm40distributewf.codeplex.com/

Removing email from CRM queue

Currently if there is email in queue and if user manually creates case then case gets creates but email remains in the CRM queue.

Another scenario is that there is automated workflow which creates case for the email which comes in queue and workflow creates case fine but email remains in the queue.

For above two problems there is not out of the box method to remove or detach the email from the queue. However when I check CRM 4.0 SDK there is API DetachFromQueueEmailRequest Based on which I have created following generic custom workflow which takes queue id and email id as Input and removes the relevant email from the relevant queue.

Following is full code snippet for this..

Register this custom workflow using Plug in Registration Tool and you can use this utility in CRM workflow screen now…

Code can be downloaded from following link
View & Download Code File