Dynamics CRM Javascript · Javascript

{Code Snippet}Accessing Subgrid on QuickView Form (Control) through JavaScript in Dynamics 365

To Access subgrid control which is available on Quick form control use below code.

function AddMembers(executionContext)
{
var formContext=executionContext.getFormContext();
var quickviewControl = formContext.ui.quickForms.get(“Member”);
if (quickviewControl != undefined) {
if (quickviewControl.isLoaded()) {
alert(“Loaded”);
var grid = quickviewControl.getControl(“QuickMembers”);
var selectedRows = quickviewControl.getControl(“QuickMembers”).getGrid().getSelectedRows();
}
else {
setTimeout(AddMembers, 300, executionContext);
}
}
}

 

The data binding for the constituent controls in a quick view control may not be complete during the main form OnLoad event because the quick view form that the control is bound to may not have loaded completely.

The isLoaded method for the quick view control helps determine the data binding status for constituent controls in a quick view control.

Hope this helps!

One thought on “{Code Snippet}Accessing Subgrid on QuickView Form (Control) through JavaScript in Dynamics 365

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s