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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Get Grid Data using Javascript API and Custom Command Button

(0) ShareShare
ReportReport
Posted on by 317

Hello,

 

I'm trying to pull data from a sub grid using JavaScript API and a custom command on the form header. I was able to do so before with a different grid when I added the custom command button to the sub grid header, so it displays within the sub grid, and call the function getgrid().getrows().

 

The sub grid I'm working with is the segment members grid within the marketing app. 
I created a custom command on the main form header and passed the PrimaryControl parameter. I believe I found the name of the control and did the following:

var formContext = PrimaryControl;
var test = formContext.getControl(/MembersControl/);

This returns info about the control, but I cant see any of the record data nor access and rows. getGrid().getRows() does not work. 
 

The two main differences between this feature and the last one I worked on is that by button is on the main form header while last time I had it within the sub grid, and I believe this is a custom control rather than a conventional sub grid added to the form. I tried to find the view within the entity on the back end but couldnt find it. 

After not having much success, I called getcontroltype() and it returned the following: customcontrol:MscrmControls.SegmentMembersHubControl.SegmentMembersHubControl

Can this not be done since it may be a custom control? Am I missing an extra step somewhere in order to retrieve the data?

Any help would be greatly appreciated!! Thank you. 

I have the same question (0)

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans