Tag Archives: Customer Lookup

Default Customer Lookup to Contact in CRM 2011

There has been a slight change in the way you default the Customer Lookup field to Contact in CRM 2011 compared with CRM 4.

Use the following code to set the Customer Lookup to Contact instead of Account and set the default view.

document.getElementById("customerid").setAttribute("defaulttype", "2");

The first line sets the default entity type to Contact for the Customer Lookup dialog.

The second line sets the Customer Lookup dialog’s view to the ‘Contacts Lookup View’ using its guid value. If you do not use this line of code it will default to the ‘My Active Contacts View’ or whatever you have selected as the default Contact view.