Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

subgrid

Posted on by Microsoft Employee

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

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

    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:)

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: subgrid

    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...

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans