locked
CRM 2015 Subgrid control is not working correctly which has working in CRm 2013 online RRS feed

  • Question

  • function RetrieveSubGridRecords() {
        var claimed;

        if (window.parent.document.getElementById("m_policymembers")) {
            var grid = window.parent.document.getElementById("m_policymembers").control;
            var arrX = new Array(grid.GetRecordsFromInnerGrid().length);

            for (var rowNo = 0; rowNo < grid.GetRecordsFromInnerGrid().length; rowNo++) {
                for (var cellNo = 3; cellNo < grid.GetRecordsFromInnerGrid()[rowNo][3].cells.length; cellNo++) {
                    arrX[rowNo] = grid.GetRecordsFromInnerGrid()[rowNo][3].cells[3].outerText;
                }

            }

    }
        else {
            setTimeout("RetrieveSubGridRecords();", 2500);
        }

    grid.GetRecordsFromInnerGrid()  it's shwoing the error  please suggest it. it's bit urgent.


    }

    Friday, January 29, 2016 2:31 AM

All replies

  • Hi,

    Please use supported way to get the rows of the grid. This will work fine if you are on CRM 2015 update 1 or later.

    You can get the window.parent.Xrm.Page.getControl("grid name").getGrid().getRows()

    var rows=Xrm.Page.getControl("grid name").getGrid().getRows();

    https://msdn.microsoft.com/en-us/library/dn932126(v=crm.7).aspx

    Thanks!
    Kalim

    Please mark as answer if it is helpful.


    Friday, January 29, 2016 3:34 AM