locked
How to display all search results that more than 100 records in lookupmulti.aspx page RRS feed

  • Question

  • Hello Everyone,

    I would like to know if there is a way to display all search results that more than 100 records in lookupmulti.apsx page, as lookupsingle.aspx has paging for search result. I do not care if I have to create a plugin, or create a customized lookupmulti.aspx page to make it work. Because our user really want this feature. 

    Thanks

    Wednesday, June 29, 2011 1:50 PM

Answers

  • The Unsupported code to do this is in  http://a33ik.blogspot.com/2009/05/record-count-per-page.html

    This is turned on automatically in CRM 2011.   The main issue as you can see is that you need to perform a record count EVERY time the grid is read, which is often.   So you will see a performance issue, so this may be a good reason to upgrade to CRM 2011.   But here the code is either way. 

     

    Pierre - @infuseme

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Crm.Sdk;
    using Microsoft.Crm.SdkTypeProxy;
    using Microsoft.Win32;
    using System.Xml;
    using Microsoft.Crm.SdkTypeProxy.Metadata;
    using Microsoft.Crm.Sdk.Metadata;

    namespace TestPlugin
    {
    public class RecordCounterExtender : IPlugin
    {
    public RecordCounterExtender(string config, string secureConfig)
    {
    }

    #region IPlugin Members

    public void Execute(IPluginExecutionContext context)
    {
    if (context.MessageName == "Execute" && context.InputParameters.Contains("FetchXml"))
    {
    XmlDocument indoc = new XmlDocument();
    indoc.LoadXml((string)context.InputParameters["FetchXml"]);

    indoc.DocumentElement.Attributes["count"].Value = "1000";
    context.InputParameters["FetchXml"] = indoc.OuterXml;
    }
    }

    #endregion

    }
    }




    • Marked as answer by abcds Wednesday, July 6, 2011 1:57 PM
    Tuesday, July 5, 2011 4:53 PM

All replies

  • The Unsupported code to do this is in  http://a33ik.blogspot.com/2009/05/record-count-per-page.html

    This is turned on automatically in CRM 2011.   The main issue as you can see is that you need to perform a record count EVERY time the grid is read, which is often.   So you will see a performance issue, so this may be a good reason to upgrade to CRM 2011.   But here the code is either way. 

     

    Pierre - @infuseme

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Crm.Sdk;
    using Microsoft.Crm.SdkTypeProxy;
    using Microsoft.Win32;
    using System.Xml;
    using Microsoft.Crm.SdkTypeProxy.Metadata;
    using Microsoft.Crm.Sdk.Metadata;

    namespace TestPlugin
    {
    public class RecordCounterExtender : IPlugin
    {
    public RecordCounterExtender(string config, string secureConfig)
    {
    }

    #region IPlugin Members

    public void Execute(IPluginExecutionContext context)
    {
    if (context.MessageName == "Execute" && context.InputParameters.Contains("FetchXml"))
    {
    XmlDocument indoc = new XmlDocument();
    indoc.LoadXml((string)context.InputParameters["FetchXml"]);

    indoc.DocumentElement.Attributes["count"].Value = "1000";
    context.InputParameters["FetchXml"] = indoc.OuterXml;
    }
    }

    #endregion

    }
    }




    • Marked as answer by abcds Wednesday, July 6, 2011 1:57 PM
    Tuesday, July 5, 2011 4:53 PM
  • Hello Pierre,

    Thanks very much for the help. It worked for me.

     

    Wednesday, July 6, 2011 1:57 PM