Get Subgrid Values in Lookup in CRM 2013 RRS feed

  • Question

  • HI all,

                how to Get Subgrid values in Plugins... Please share the code...

    Tuesday, February 4, 2014 12:27 PM


  • Create a field in the entity in which the subgrid is present. Now get the values using the javascript like the one below,

    function GetSubGridSelectedRows() { var grid = document.getElementById("accountContactsGrid").control; for (var rowNo = 0; rowNo < grid.get_selectedRecords().length; rowNo++) { alert(grid.get_selectedRecords()[rowNo].Id); alert(grid.get_selectedRecords()[rowNo].Name); } }

    Now fire the plugin on update of this field. You will get the selected records inside the plugin

    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Tuesday, February 4, 2014 2:26 PM