Friday 28 July 2017

Get Selected rows of the sub grid from Dynamic CRM using XRM and JavaScript.

Get Selected rows of the sub grid from Dynamic CRM using XRM and JavaScript.

Description:

In this example we explain that how to get selected rows of the sub grid from Dynamic CRM using XRM and JavaScript. Or how to read the selected rows from sub grid using JavaScript in Dynamic CRM.or how to fetch the selected rows form sub grid in Dynamic CRM using JavaScript. Or how to get all the selected rows from sub grid from dynamic CRM using JavaScript.

Here we demonstrate how to get the selected rows from the sub grid in Dynamic CRM using JavaScript.


     The below code will returns the collections of the selected records (rows) from sub grid.

 Code:

var selectedRows = Xrm.Page.getControl("States").getGrid().getSelectedRows();
    selectedRows.forEach(function (selectedRow, i) {
        var s = selectedRow.getData().getEntity().getEntityReference();
         var selectedRowGuid=s.id;
        var selectedRowName=s.name;
        var selectedRowEntityName=s.entityType;



    });



0 comments:

Post a Comment