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)

subgrid

(0) ShareShare
ReportReport
Posted on by

hi all

how i can count the records of a subgrid that have a unique value on special column?

for eg the number of city that my contacts are from?

*This post is locked for comments

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    You can do it with JavaScript and Grid events.

    You can use the following syntax to get the grid object:

    var myGrid = Xrm.Page.getControl("MyGridName");

    and the following syntax to get the gridRows:

    var allGridEntities = [];

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

    allRows.forEach(function (row, i) {

    allGridEntities.push(row.getData().getEntity());

    });

    See the following link for information on the Grid events:

    msdn.microsoft.com/.../dn932126.aspx

    Hope this helps...

  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    You can achieve this by using web api as well to get associated records.

    Please see below link:

    community.dynamics.com/.../198070

    www.inogic.com/.../querying-data-in-microsoft-dynamics-crm-2016-using-web-api

    Hope this helps:)

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans