locked
How to get records from Subgrid in CRM 2011? RRS feed

  • Question

  • Hello,

    How can we get Records from CRM Subgrid ?

    I want to check for perticular field in that subgrid and then i want to filter my another subgrid.


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

    Monday, August 5, 2013 9:19 AM

Answers

  • Hi,

    Actually i got the solution.

    There is a update, i have used below code

    Xrm.Page.ui.controls.get("SubGridName")._control.get_innerControl().get_allRecords();


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

    • Marked as answer by DynamicsCRM31 Tuesday, August 6, 2013 11:05 AM
    Tuesday, August 6, 2013 11:05 AM

All replies

  • Hello All,

    After Rollup 13 ,some js functions are not working and because of that i am not finding any method to get the records of grid.

    Please let me know if there is any update on the same.


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

    Tuesday, August 6, 2013 6:57 AM
  • The best way to get records from a subgrid would be to use a SOAP/REST/FetchXML JavaScript request to retrieve the related records (unless this subgrid is also being filtered with JavaScript).

    Once you've retrieved the records you can filter your other grids.

    When doing retrieves in JavaScript now you will need to use 'XmlHttpRequest' for cross-browser support instead of the old ActiveXObject.

    http://crmblog2011.blogspot.co.nz/2013/02/cross-browser-solution-for.html

    Hope that helps

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Tuesday, August 6, 2013 7:24 AM
  • Hi,

    Actually i got the solution.

    There is a update, i have used below code

    Xrm.Page.ui.controls.get("SubGridName")._control.get_innerControl().get_allRecords();


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

    • Marked as answer by DynamicsCRM31 Tuesday, August 6, 2013 11:05 AM
    Tuesday, August 6, 2013 11:05 AM
  • The reason I didn't suggest that way is because 1, it uses unsupported JavaScript and could break at any time with a new rollup, and 2, it will only get you the records on the first page, so if your subgrid shows 1-10 of 12 for example, you will only be able to get the first 10 records.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Tuesday, August 6, 2013 7:26 PM
  • Can you give me such example of such call of getting total records of subgrid ?

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

    Wednesday, August 7, 2013 8:50 AM
  • I posted the example in my first post:

    http://crmblog2011.blogspot.co.nz/2013/02/cross-browser-solution-for.html

    That is getting accounts by a certain ID. You just need to change it to filter on your parent entity ID, then at the bottom you can access all the results.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Wednesday, August 7, 2013 10:37 AM