Friday, June 5, 2009

How to re-assign records of one user to another user in Dynamics CRM

Sometimes when one of the users is no longer associated with the company or if the responsibilities of a user is changed, there is a need to re-assign all records of this user to another user.

Steps to re-assign records:

1. Open the User Form of the user whose records need to be re-assigned.

2. Choose the Re-assign Records menu option from the Actions menu



3. From the form options that come up choose the option to select the user.



This will re-assign all records of the user to another user. This does away with the need to manually create views for each type of entities and then assign it to other users.


Tuesday, June 2, 2009

IFD Login code for Custom apps

With CRM 4.0 and IFD getting popular by the day. We have had to work on the Login function for CRM to support IFD install. In case of IFD the authentication type is changed to Forms Authentication where you are presented with a Sign-in page for login.

Further to our post on
Login for various CRM deployments here is the code for IFD that has been added to the list.

The code below should help users developing application that need to work from an IFD environment.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
///


/// login to crm with Default Credential for IFD

//set orgname and url to properties
strOrg = strOrgName;
strserverurl = strCRMURL; // It must have on- premise url for example http://moss:5555

//init CrmImpersonator object
_impersonator = new CrmImpersonator();

//Initialize CrmAuthenticationToken token
token = CrmAuthenticationToken.ExtractCrmAuthenticationToken(context, strOrgName);
token.OrganizationName = strOrgName;
token.AuthenticationType = 0;

//initialize the Service
service = new CrmService();

//pass DefaultCredentials
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

//pass CrmAuthenticationTokenValue
service.CrmAuthenticationTokenValue = token;
service.Url = strCRMURL + "/mscrmservices/2007/crmservice.asmx";


Thursday, May 28, 2009

How to login in console mode through Remote Desktop

Recently we came across a situation where we had to logon to a windows server remotely and yet open it in console mode. This means that we needed to be identified as being locally logged on instead of being treated as a remote desktop user.
We found that remote desktop command has various commandline arguments that can be used to connect. One of the arguments is /console which did the trick for us.
The command is mstsc /console
I hope this tip helps others with similar neeeds.

Monday, May 18, 2009

Form assistant

In CRM 3.0 there was no easy way to control the Form assistant window. We could get it done by making some changes to the customization file before importing into CRM.



In CRM 4.0, we have now been given the option to decide the Form Assistant settings for each entity. You are most likely to miss it and I have seen many queries on this.

To alter the Form assistant settings, follow the steps below:

1) Go to Settings => Customizations => Customize the entity in our case it is Product
2) Open product entity and go to Forms and views. Select the Form
3) Here, go to Form Properties => Display tab




Now, if both these checkboxes are checked you can see the form assistant open by default.

If, you uncheck the “Expanded by Default” checkbox, then the form assistant will be there but will not be open up by default as shown in the screen below:




Whereas, if you uncheck both the checkboxes i.e. “Expanded by Default” and “Enable form assistant”, then the form assistant will not be visible at all as shown in the screen below:


It is important to publish the entity after any customization change is made to it.

Tuesday, May 12, 2009

Bulk Delete Operations for Dynamics CRM 4 On-Premise


It is often that have you come across when you wanted to delete records from CRM in bulk.

The only option you have to delete multiple records in CRM is by selecting all records available in one page of a view and then hit delete. A view can have at max 250 records displayed. So if you need to delete more than that you have no choice but to navigate through each page and delete the records.

Since we do a lot of conversion projects we need to delete previously imported records before running the conversion. And this was too much of a task...

We started working on developing our own little project that will do the job. CRM has made available the BulkDeleteRequest Message in CRM SDK that allows us to delete more than one entity records at a time.

The BulkDelete Message will create an asynchronous job that can be monitored through the System Jobs Menu option.

You can provide the record selection criteria by specifying the query that needs to be executed to get the records over which the action needs to be performed.

If you want this to a recurring job to be executed say every x days, you can set the RecurrencePatern of the BulkDeleteRequest Message.

Since the bulk delete operation can be run on any entity and it requires a query to be provided, we thought of generalizing this. We developed a small tool that allows the users to specify the parameters for the Bulk Delete Job in user friendly interface. These jobs can be monitored in the system jobs window.

Anyone who would like to get this tool without having to re-invent the wheel can check details at http://www.inogic.com/addons_bulk_delete.htm