Tuesday, February 28, 2012

To load records, click here in ms crm 2011. Sub-grid does not load automatically

If you have more than 4 sub-grids in a form u have inserted, CRM will automatically load the 1st 4 sub-grids and for the rest sub-grid it will not load, rather it will give a link "To load <entityname> records, click here."
This is because CRM takes care of the efficiency of the form to be loaded faster.
if you want to load the grids after 4th grid, then get the object of the sub-grid and force it to load.
Xrm.Page.ui.tabs.get('<TabName>').controls.get('<Subgrid_Name>').refresh().

hope this helps.

thanks,
yes.sudhanshu

3 comments:

  1. Hi, Thanks for this solution.

    I have cleared this issue on the required entities in my CRM system but when I try to export that grid to Excel this gives the empty Excel sheet. I can see the fields on the Excel sheet but there is no data though I can see data on the CRM grid. If I disable this Script Am able to export the data on to excel. Can you please help.

    Thank you
    uday

    ReplyDelete
    Replies
    1. Hi Uday Kumar,
      can you please explain me how to import the data from subgrids texcel.

      Delete
  2. hi,

    as the eport to excel etc are present in the ribbon, may be that functionality is not added while its loading the form as by default the sub-grid not loaded.
    and on click of the hyperlink(Click to load) inside the sub-grid , it may call some other functions to enbale the functionality of exporting to excel, so all records will come.
    as we are forcing the grid to load by the code, we need to find that function which binds the records, if we are clicking the export to excel.
    so far am not aware of that :(
    if you found anything please share...

    thanks,
    yes.sudhanshu

    ReplyDelete