Setting Custom View as default for lookup in Connection entity. (CRM 2011)

To create a custom view for a lookup, we can refer to this blog post


lookupControl.addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

Setting last parameter as “true” sets the custom view as default. However this was not happening in case of connection entity lookups.

So to finally achieve this we did the following

Modify the lookupinfo.aspx “..\Microsoft Dynamics CRM\CRMWeb\_controls\lookup”.

Find the function named handleView and modify it to show our custom view as default.

function handleView(o, entity){
var selObjectsDropdown = (typeof (selObjectsList) == Mscrm.TypeNames.undefinedType) ? selObjects : selObjectsList;

if (o.innerHTML.indexOf(‘Case Member View’)!=-1){

var sOriginalViewId = “{C0F1DD64-1BF3-450D-BCDE-DF4732DE1001}”;

else {

var sOriginalViewId = crmGrid.GetParameter(“viewid”);
if (selObjectsDropdown.selectedIndex != -1 && selObjectsDropdown.options.length > 0) {
var tempDefaultViewId = selObjectsDropdown.options[selObjectsDropdown.selectedIndex].guid;
if (!IsNull(tempDefaultViewId)) {

sOriginalViewId = tempDefaultViewId;}}}

. . . . . . . .

. . .

It is an unsupported customization!!!!


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Setting Custom View as default for lookup in Connection entity. (CRM 2011)”

    1. My selObjectsDropdown is getting “undefined” so in my further code it not match with entity id which is “2”. that’s why filtering is not happening.


Please share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.