POWEROBJECTS

718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

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!

tips-and-tricks

pexels-photo-51415

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!


Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.