To create a custom view for a lookup, we can refer to this blog post
https://nishantrana.wordpress.com/2010/12/31/filtered-lookup-in-crm-2011/
Here
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!!!!
Bye..