Disable column in Dynamics CRM editable subgrid based on a condition
I need to disable (make read-only) a column from an editable subgrid in a Dynamics CRM 365 form.
In MS doc (https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt788311(v=crm.8), the way to get this done is by getting controls with:
Xrm.Page.getControl("Opportunity_Installments").getGrid().getRows().getAll()[0].getData().entity.attributes.getAll()[0].controls
but the problem is that controls array is always null, so I cannot disable the column (apply setDisable
function on control)
In IE console, the expression Xrm.Page.getControl("Opportunity_Installments").getGrid().getRows().getAll()[0].getData().entity.attributes.getAll()[0].controls
returns null.