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.