Quick view forms in Dynamics CRM 2016 allow you to display all the related entity information.
Is there a way to retrieve the field value on Quick View Form using JavaScript without additional
OData call to the associated entity?
The answer is Yes and here is the sample JavaScript to achieve the same:
function getQuickViewFormAttributeValues() {
var quickViewControl = Xrm.Page.ui.quickForms.get("<QuickViewControlName>");
if (quickViewControl != undefined)
{
if (quickViewControl.isLoaded())
{
// Access the value of the attribute bound to the constituent control
var myattrValue1 = quickViewControl.getControl(0).getAttribute("<attribute name>").getValue();
var myattrValue2 = quickViewControl.getControl(1).getAttribute("<attribute name>").getValue();
console.log(myattrValue1 + myattrValue2);
return;
}
else
{
// Wait for some time and check again
setTimeout(getAttributeValue, 10);
}
}
else
{
console.log("No data to display in the quick view control.");
return;
}
}
Is there a way to retrieve the field value on Quick View Form using JavaScript without additional
OData call to the associated entity?
The answer is Yes and here is the sample JavaScript to achieve the same:
var quickViewControl = Xrm.Page.ui.quickForms.get("<QuickViewControlName>");
if (quickViewControl != undefined)
{
if (quickViewControl.isLoaded())
{
// Access the value of the attribute bound to the constituent control
var myattrValue1 = quickViewControl.getControl(0).getAttribute("<attribute name>").getValue();
var myattrValue2 = quickViewControl.getControl(1).getAttribute("<attribute name>").getValue();
console.log(myattrValue1 + myattrValue2);
return;
}
else
{
// Wait for some time and check again
setTimeout(getAttributeValue, 10);
}
}
else
{
console.log("No data to display in the quick view control.");
return;
}
}