How to get subgrid record guid RRS feed

  • Question

  • Hello,

    I have added sub grid in an entity. When i use below code

    var gridControl = document.getElementById('Project').control;
    var ids = gridControl.get_allRecordIds();
    for(i = 0; i < ids.length; i++) {
    var cellValue = gridControl.getCellValue('new_consultantname01', ids[i]);

    I'm getting id's which is not matching with guid of record in subgrid. When i searched about this i came to know that whatever subgrid shows is view so the id we get is of the view not of record's. How to get the guid of record in subgrid. I want guid to retrieve annotation of that record. When i add record to subgrid , then automatically , the annotation associated with record will be inserted in the entity in which subgrid is being displayed. My actual task is to retrieve the annotation of record selected in subgrid. How to do this

    Madhu Sudhan.M

    Friday, October 5, 2012 11:43 AM

All replies

  • I am not getting what is your requirement? I am 100 percent sure ids in the above code will return the ids of the records in the grid. I have used it so many times.

    I have written a blog on it.


    If you want to get the guid of selected record then you can use the get_selectedIds() method.

    it will look like something like


    This code is not supported. Try using the Xrm.Page object as I used in the blog.

    I hope this helps.

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior Solution Architect HP Australia Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

    • Proposed as answer by Amreek Singh Friday, October 5, 2012 1:43 PM
    Friday, October 5, 2012 1:43 PM
  • Thank you Amreek Singh for your reply ,

    Above screen shot shows the subgrid which contains records from resdex entity. When i add these records to subgrid in project, i have written jscript to add annotation attached to resdex record to project annotation. Below screen shot you can see the two annotations of resdex records getting added to project entity. Now my requirement is to create a pop up window onclick of button in project entity ribbon, which shows the records in subgrid. In popup window i need to give option to update n delete annotations of particular record in subgrid. Hope this time i'm not that much confusing. 

    Madhu Sudhan.M

    Monday, October 8, 2012 4:22 AM