Thursday, 6 July 2017

Read SubGrid Records in Dynamic CRM using JavaScript.

Read SubGrid Records in Dynamic CRM  using JavaScript.
Description:

In this example we explain that how to read data from SubGrid in Dynamic CRM using JavaScript. Or how to retrieves rows of the SubGrid in Dynamic CRM using JavaScript. Or how to fetch the list of the rows or records from the sub grid in dynamic CRM using JavaScript.

So here we demonstrate to retrieve rows and columns from sub grid in dynamic CRM using JavaScript.

Code:

function FetchSubGridRows() {
    if (document.getElementById("SubGridName")) { //here you put your subgrid name.
        var grid = document.getElementById("SubGridName").control;
        for (var rowNo = 0; rowNo < grid.GetRecordsFromInnerGrid().length; rowNo++)
            for (var cellNo = 0; cellNo < grid.GetRecordsFromInnerGrid()[rowNo][3].cells.length; cellNo++)
                alert(grid.GetRecordsFromInnerGrid()[rowNo][3].cells[cellNo].outerText);
    }
    else {
        setTimeout("FetchSubGridRows();", 2500);
    }

}



0 comments:

Post a Comment