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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

(0) ShareShare
ReportReport
Posted on by 595

I upgrade from CRM 2011 to CRM 2013 and my old script doesn't work. Error message:

<Message>Object doesn't support property or method 'getRecordsFromInnerGrid'</Message>

Pie of my script:
....
for (var intRowNumber = 0; intRowNumber < gridControl.getRecordsFromInnerGrid().length; intRowNumber++) {
var id = grid.control.getRecordsFromInnerGrid()[intRowNumber][3].cells[3].outerText;
....

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Zully Escobar N Profile Picture
    25 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Javascript is case sensitve.

    Must be GetRecordsFromInnerGrid, and not getRecordsFromInnerGrid

    http://asimsajjad.blogspot.com/2012/01/how-to-get-selected-rows-of-grid-using.html

  • Vijay Waghmare Profile Picture
    on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Glad to help you, kindly mark my answer as verified if worked.

  • Mary CRM Profile Picture
    595 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Thank you, Vijay! I did everything :)

  • Verified answer
    Vijay Waghmare Profile Picture
    on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    By looking at your code I guess you are creating a link dynamically based on id of records and replacing it with grid column as URL/link.

    I suspect changing or accessing DOM elements in unsupported way causing this issue.

    But to have supported way solution for it, please follow the below steps,

    1 - Create a single line of text with format as a URL for your subgrid entity.

    2 - Add this newly created field in your view.

    3 - While creating/updating a subgrid entity record, using workflow or plugin create required link and map to newly created field.

    Rest will be handled by the CRM to display in subgrid column as a clickable link/URL. Doing so, it will be treated as supported way of customizing CRM. No coding is required to change the DOM at runtime.

    Hope this helps.

    Thanks,

    Vijay Waghmare

  • Mary CRM Profile Picture
    595 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    This link doesn't help. The error message the same

    <Message>Object doesn't support property or method 'getRecordsFromInnerGrid'</Message>

    My full code:

    function somefunc() {
    if (document.getElementById("someid"))

    {
    var grid = document.getElementById("someid");
    grid.attachEvent("onrefresh", somefunc);

    var websiteLink = "htp://somelink";
    var gridControl = grid.control;

    for (var intRowNumber = 0; intRowNumber < gridControl.getRecordsFromInnerGrid().length; intRowNumber++) {
    var id = grid.control.getRecordsFromInnerGrid()[intRowNumber][3].cells[3].outerText;
    var newLink = websiteLink + id;

    var newElement = document.createElement('a');
    newElement.setAttribute('href', newLink);
    newElement.setAttribute('title', id);
    newElement.setAttribute('target', '_blank');

    newElement.style.textDecoration = 'underline';
    newElement.style.cursor = 'hand';
    newElement.style.color = '#0645AD';

    var someItem = grid.control.getRecordsFromInnerGrid()[intRowNumber][3].cells[3].children[0].firstChild;

    newElement.appendChild(someItem.cloneNode(true));
    someItem.parentNode.replaceChild(newElement, someItem);
    }
    }
    else
    {
    setTimeout('somefunc();', 2500);
    }
    }

     

  • Suggested answer
    Vijay Waghmare Profile Picture
    on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Here is another link that may help you, I think you are facing same issue here of event is firing before subgrid loads

    social.microsoft.com/.../how-to-get-selected-record-values-in-subgrid-using-javascript-in-ms-crm-2013

    Thanks,

    Vijay Waghmare

  • Mary CRM Profile Picture
    595 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Sorry, but I don't understand what you mean.
    And I also saw this link, its not useful for me. 

    May be there are the same function in CRM 2013? Why this function is not supported..

  • Suggested answer
    Vijay Waghmare Profile Picture
    on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Option 1 : Please refer below URL for getting IDs of all records displayed in subgrid.

    Once you are with Subgrid record IDs, you can query database to get required data. (This will be in loop and you need to fire multiple queries)

    http://stackoverflow.com/questions/17651752/how-to-retrieve-all-record-ids-of-a-sub-grid-in-crm-2011-using-javascript

    Option 2: Since you are aware of what data is being displayed in subgrid (based on criteria), you can have a single query to fetch the records based on same criteria and loop through the result for your desired output.

    Hope this helps.

    Thanks,

    Vijay Waghmare

    javascript:void(0);

  • Mary CRM Profile Picture
    595 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Anybody?

  • Mary CRM Profile Picture
    595 on at
    RE: Object doesn't support property or method 'getRecordsFromInnerGrid'. CRM 2013

    Nobody encountered this problem??

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans