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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Read all record from Subgrid - using Javascript

(0) ShareShare
ReportReport
Posted on by 1,000

I have "loans" Sub Grid in form. In that grid i have 3 records. But i show 2 records in one page of that grid and show another 1 record in next page.

In loansGridTotalCount i got count as 3.

Inside of that for loop am trying to get rollNumber  values.  I got first two record's roll number value in rollNumber(variable).

If i try to get 3 rd record value i got the error.

var loansGridTotalCount = window.parent.Xrm.Page.getControl("Loans").getGrid().getTotalRecordCount();

for(var i=0;i<loansGridTotalCount ;i++)

{

recordId = window.parent.Xrm.Page.getControl("Loans").getGrid().getRows().get(response).getData().getEntity().getId();


var rowData = window.parent.Xrm.Page.getControl("Loans").getGrid().getRows().get(response).getData().getEntity().getAttributes();

var rollNumber = rowData.get("new_rollNumber").getValue();

}

How can I get all the records from all pages in subgrid ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Vijay,

    I don't think it is possible to get all the records from all the pages in sungrid.

    stackoverflow.com/.../reading-all-records-of-a-subgrid-regardless-of-the-active-page-with-javascript-i

    Hope this helps.

  • Suggested answer
    meenoo Profile Picture
    7,316 on at

    Hi Vijay,

    Try this:

    var allRows = Xrm.Page.getControl("Loans").getGrid().getRows();

    This returns a collection of every GridRow in the Grid.

    Thank you.

  • ashlega Profile Picture
    34,477 on at

    Hi Vijay,

     if you want all the records, you have to start thinking "view/query" rather than "grid". For the grid control, you'll get only those rows which are displayed. If, however, you re-write your javascript to go back to the server (webapi etc) and query all the same data from the server, you should be able to get all those records:

    msdn.microsoft.com/.../mt742431.aspx

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans