locked
Lookup Form Customization RRS feed

  • Question

  • Hi,

    Is it possible to resize lookup form?

    Can we increase the column width of lookup form above 300px?

    Regards

    Faisal

    Tuesday, November 2, 2010 7:07 PM

Answers

  • You want to widen the actual Lookup dialog box?  I don't believe there's a supported method for that, however, the answer lies in the Lookup.js file, in the <crm webroot>\_static\_controls\lookup directory.  There, in the BuildFeatures() function, you'll find the hard-coded presets for the height and width of the Lookup dialogs.  Unfortunately, these settings are global, so modifying them in the file is not entirely recommended.

    What you can do, however, is override the function for the form that requires the modification.  Again, this is highly unsupported, but if you use the following code, it might work:

    // Overridden BuildFeatures function
    BuildFeatures = function(lookupStyle)
    {
    var oFeatures = new Object();
    
    switch (lookupStyle)
    {
    case "multi":
    oFeatures.height = "460px";
    oFeatures.width = "600px";
    break;
    case "single":
    oFeatures.height = "488px";
    oFeatures.width = "600px";
    break;
    case "subject":
    oFeatures.height = "450px";
    oFeatures.width = "500px";
    break;
    default:
    alert(LOCID_LOOKUPSTYLE_NOT_SET + lookupStyle);
    return null;
    }
    
    return oFeatures;
    }
    

    All you should need to do is alter the presets desired for usage in the specific form, and deploy that code to the OnLoad function of the form.  It probably will, however, affect all of the Lookup dialogs on that form (but at least it won't affect the whole CRM site).  Unfortunately, I don't think there's any other way to get it to work without completely replacing the functionality of a Lookup, or picking up an ISV solution that does so .


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    • Marked as answer by Faisal Fiaz Wednesday, November 3, 2010 4:35 PM
    Tuesday, November 2, 2010 8:37 PM
    Moderator

All replies

  • I can resize the column width by exporting customization and editing xml. So the question is can I resize lookup Form.

    Regards

    Faisal

    Tuesday, November 2, 2010 8:09 PM
  • You want to widen the actual Lookup dialog box?  I don't believe there's a supported method for that, however, the answer lies in the Lookup.js file, in the <crm webroot>\_static\_controls\lookup directory.  There, in the BuildFeatures() function, you'll find the hard-coded presets for the height and width of the Lookup dialogs.  Unfortunately, these settings are global, so modifying them in the file is not entirely recommended.

    What you can do, however, is override the function for the form that requires the modification.  Again, this is highly unsupported, but if you use the following code, it might work:

    // Overridden BuildFeatures function
    BuildFeatures = function(lookupStyle)
    {
    var oFeatures = new Object();
    
    switch (lookupStyle)
    {
    case "multi":
    oFeatures.height = "460px";
    oFeatures.width = "600px";
    break;
    case "single":
    oFeatures.height = "488px";
    oFeatures.width = "600px";
    break;
    case "subject":
    oFeatures.height = "450px";
    oFeatures.width = "500px";
    break;
    default:
    alert(LOCID_LOOKUPSTYLE_NOT_SET + lookupStyle);
    return null;
    }
    
    return oFeatures;
    }
    

    All you should need to do is alter the presets desired for usage in the specific form, and deploy that code to the OnLoad function of the form.  It probably will, however, affect all of the Lookup dialogs on that form (but at least it won't affect the whole CRM site).  Unfortunately, I don't think there's any other way to get it to work without completely replacing the functionality of a Lookup, or picking up an ISV solution that does so .


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    • Marked as answer by Faisal Fiaz Wednesday, November 3, 2010 4:35 PM
    Tuesday, November 2, 2010 8:37 PM
    Moderator