Monday, 12 December 2011

How to retrieve the Selected Record Ids of a Sub Grid in CRM 2011 using javascript

How to retrieve the Selected Record Ids of a Sub Grid in CRM 2011 using javascript
Code Snippet:
    var gridControl = document.getElementById("yourSubGridName").control;
    var ids = gridControl.get_selectedIds();

2 comments:

  1. hi i am using the above code and it is not working for me. kindly help me.
    Note: my code is

    var gridControl = document.getElementById("purposegrid").control;

    here "purposegrid" is my sub-grid name.

    ReplyDelete
    Replies
    1. Hi,

      Did you copy and paste the code?
      Sometimes the double quotes would cause problems when pasted from web. So delete the double quotes and type manually from your keyboard. your code looks alright if the sub-grid name is correct. Pls try this

      Delete