Skip to main content

Disable All Fields Microsoft Dynamics CRM

For CRM 2011:
function DisableForm()
{
    Xrm.Page.ui.controls.forEach(
        function (control, index)

        {
            if (control.getControlType() != "subgrid")
                control.setDisabled(true);
        });
}

 
For CRM 4:
function ToggleFormFields(disable)
{
    for (var i = 0; i < crmForm.all.length; i++)
    {
        if (crmForm.all[i].req)
        {
            crmForm.all[i].Disabled = disable;
        }
    }
}

Comments