简体   繁体   中英

dynamics crm get name of subgrid on associated view

When I open the contact form and then select activities from the navigation bar, the associated activities view appears. Is there a way to get the name of the subgrid for this view? I

var subgrid = Xrm.Page.getControl(<sub-grid name>);

Note: This is unsupported customization.

Getting Associated view grid is different from subgrid in entity forms. Subgrid in CRM form is accessible using Xrm.Page.getControl(subgrid_name) like any other control.

But to access Associated view grid, you have to do DOM manipulation starting from IFRAME, then Grid like below.

To get the IFrame control:

var frame = document.frames[“areaActivitiesFrame”].frameElement;

To refresh the associated grid view:

frame.contentWindow.document.getElementById(“crmGrid_Account_ActivityPointers”).control.refresh();

Once you get the control, try to override the click event like explained in SO thread

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM