In this webinar, our experts showcase a variety of demo use cases of how different components of the...
Microsoft Dynamics CRM 2016 On-premises provides several new capabilities and methods to working with sub grids. Here are two quick tips for using those capabilities!
1. If you want to hide or show a sub grid based on some conditions, you will use the following command to set visibility:
Xrm.Page.getControl("gridname").setVisible(false);
2. If you need interact with the row that is being selected and get some information or populate specific data, CRM 2016 provides new methods that will give the user an option to interact with them. In this example, we are populating an array with the selected row from the grid. The array is a collection of entity references, for example, lookups:
var selectedRowsArray = [];
var selectedRows = Xrm.Page.getControl("gridname").getGrid().getSelectedRows();
selectedRows.forEach(
function (selectedRow, i) {
selectedRowsArray.push(selectedRow.getData().getEntity().getEntityReference());
});
That's all for the blog today! You can learn more by checking out The CRM Book, our blog, and this additional resource.
Happy CRM'ing!