Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Get value from subgrid in unified interface

Posted on by 115

Hello, i'm facing trouble when try to get value from subgrid. Here is my code:

function editableGridRow()
{
	
	
	var childsubGrid = window.parent.Xrm.Page.getControl("ChildGrid").getGrid();
	var TotalRecordCount = childsubGrid.getRows();
	
	TotalRecordCount.forEach(function (row, i) {
            
			var gridColumns = row.getData().entity.getAttributes().getByName("new_numberitems");
			
			var value = gridColumns.getValue();
			//loop through each column in row
			alert("NAME: "   value);
            
        });
}

this code work in standar interface. but when change to unified interface it's not work. What should i change in my code ? need help, thanks .

  • FikriHailal Profile Picture
    FikriHailal 115 on at
    RE: Get value from subgrid in unified interface

    Thanks you, it works

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Get value from subgrid in unified interface

    Hi Fikri,

    We can use following code to work in UCI.

    var gridControl = window.parent.Xrm.Page.getControl("ChildGrid").getGrid();
    var gridRows = gridControl.getRows();
    gridRows.forEach(function (row, i) {
       var gridColumns = row.getData().getEntity().attributes;
       var value = gridColumns.get("fullname").getValue();
       //loop through each column in row
       console.log("NAME: "   value);
    });

    pastedimage1600242609178v1.png

    Regards,

    Clofly

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans