Wednesday, September 12, 2012

CRM 2011-Javascript to disable a field except create form

function DisableFieldAfterCreation(fieldName)
{
var formType = Xrm.Page.ui.getFormType();
if(formType != 1)
{
var field=Xrm.Page.ui.controls.get(fieldName);
if(field != null)
{
field.setDisabled(true);
}
}
}

Note: call this method onload of form and pass field name as parameter

No comments:

Post a Comment