Hi
I have tried this code from this thread: https://community.dynamics.com/crm/f/117/t/234394. But I cant get the code to work. The script always returns 0, even if the subgrid cointains records.
Anyone have an idea to how a can get a script to show me if a subgrid contains records or not?
Thanks!
function CheckRows() {
var grid = Xrm.Page.getControl("children_subgrid");
if (grid == null) { //make sure the grid has loaded
setTimeout(function () { CheckRows(); }, 2000); //if the grid hasn’t loaded run this again when it has
return;
}
var filteredRecordCount = grid.getGrid().getTotalRecordCount();
if (filteredRecordCount == 0) {
grid.setVisible(false);
}
}
*This post is locked for comments
I have the same question (0)