web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 140

I've a subgrid named TimeTickets, I try: var gridControl = document.getElementById('TimeTickets_d').control var ids = gridControl.get_allRecordIds(); here I've an error :Object doesn't support property or method 'get_allRecordIds'

*This post is locked for comments

I have the same question (0)
  • AndrewCampey Profile Picture
    on at

    As the error states the method get_allRecordIds is not supported for that particular control.

    I'd suggest you use this instead

    Xrm.Page.ui.controls.get('TimeTickets')._control.get_innerControl().get_allRecordIds()

  • Paul Talbot Profile Picture
    on at

    This does not work in CRM 2013. I am desperate for a solution to our broken code.

  • Suggested answer
    Hosk Profile Picture
    on at

    this blog has some Javascript code for subgrids in CRM 2013

    vikramxrm.blogspot.co.uk/.../read-subgrid-records-ms-crm-2013-using.html

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    Although you can get the selected items using unsupported javascript methods, you might consider using a neat 'trick' as a more supported solution. You use an 'EnableRule' on a subgrid button that is passed the SelectedControlSelectedItemIds parameter. This function is then called everytime a record is selected/deselected and you can store the results in a variable that can be used else where in your javascript.

    This trick was originally thought up by James Wood - woodsworkblog.wordpress.com/.../crm-2013-adding-an-on-change-event-to-a-sub-grid

    Hope this helps,

    Scott

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans