locked
MSCRM SubGrid - throwing exception get_allRecordIds(); for sub grid RRS feed

  • Question

  • How to loop ? Throwing exception that get_allRecordIds(); does not in subgrid . Thanks in advance ...

    Please reply ...


       var iSubGrid = 'xyz';
       var gridControl = Xrm.Page.getControl(iSubGrid);
     
        for (var intRowNumber = 0; intRowNumber < gridControl.getRecordsFromInnerGrid().length; intRowNumber++) {
            for (var intCellNumber = 0; intCellNumber < gridControl.getRecordsFromInnerGrid()[intRowNumber][1].cells.length; intCellNumber++) {
                alert('For Lookp 2');
                alert(gridControl.getRecordsFromInnerGrid()[intRowNumber][1].cells[intCellNumber].outerText);
            }
        }

     var ids = gridControl.get_allRecordIds();
        for (i = 0; i < ids.length; i++) {
            alert('For Lookp');
            var cellValue = gridControl.getCellValue('acivityaccount', ids[i]);
            // logic
        }


    Sanjay
    Monday, December 12, 2011 7:40 AM

Answers

  • try the following code

    var gridControl = document.getElementById(iSubGrid).control;
    var ids = gridControl.get_allRecordIds();
    



    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Marked as answer by Sanjay KS Tuesday, December 13, 2011 10:54 AM
    Monday, December 12, 2011 8:01 AM
  • Thank's it is working ....

     


    Sanjay
    • Marked as answer by Sanjay KS Thursday, January 12, 2012 7:39 AM
    Tuesday, December 13, 2011 10:54 AM

All replies

  • try the following code

    var gridControl = document.getElementById(iSubGrid).control;
    var ids = gridControl.get_allRecordIds();
    



    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Marked as answer by Sanjay KS Tuesday, December 13, 2011 10:54 AM
    Monday, December 12, 2011 8:01 AM
  • Not Working ...

     


    Sanjay
    Tuesday, December 13, 2011 10:05 AM
  • Thank's it is working ....

     


    Sanjay
    • Marked as answer by Sanjay KS Thursday, January 12, 2012 7:39 AM
    Tuesday, December 13, 2011 10:54 AM