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 365 | Integration, Dataverse...
Suggested Answer

Accessing Subgrid on QuickView Form (Control) through JavaScript in Dynamics 365

(0) ShareShare
ReportReport
Posted on by 20

By using below code unable to get selected rows from Quick view form subgrid.

var quickviewControl = formContext.ui.quickForms.get("Member");
    if (quickviewControl != undefined) {
        if (quickviewControl.isLoaded()) {
            alert("Loaded");
            var grid = quickviewControl.getControl("QuickMembers");
            var selectedRows = quickviewControl.getControl("QuickMembers").getGrid().getSelectedRows();
        }
        else {
            setTimeout(AddMembers, 3000, primaryControl);
        }
    }

Please advise

Thanks in advance.

I have the same question (0)
  • Linn Zaw Win Profile Picture
    3,407 on at

    Your code seems to be fine. I am able to get the selectedRows by using the same code of yours.

    What is the problem? Is selectedRows varible getting null for your code? What are you going to do after getting selectedRows in your code?

    pastedimage1592520878757v2.png

  • Harsh_B Profile Picture
    20 on at

    In UCI, we are getting below error messages.

    Error 1:

    TypeError: Object doesn't support property or method 'getName'

    or

    Error 2:

    Unable to get property 'getGrid' of undefined or null reference

    Based Selected Rows data new to create Members records in Custom entity.

    Thanks in Advance

  • Linn Zaw Win Profile Picture
    3,407 on at

    Can you try to debug your JavaScript to see which object is invalid/null?

    Error 1: There is not even "getName" in the code snippet that you provided.

    Error 2: Check if the name of the grid view in the quick view form is correct. Debug the code and see if the quickviewControl.getControl("QuickMembers") is null

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Please add check condition as below.

    var grid = quickviewControl.getControl("QuickMembers");

    if(grid!=null and grid!=undefined)

    {

    var selectedRows = grid.getGrid().getSelectedRows();

    }

    Also you should mention subgrid control Name not label . Check if QuickMembers is Name of the subgrid or label.

    If found helpful, Please mark my answer verified.

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 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 51 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans