hi all,
to disable a optionset field, I have done the following code pelase review this and let me know where I am wrong
function
update()
{
varfields = ['boardfile','psychological','medicalreleaseform'];
varformtype = Xrm.Page.ui.getFormType();
vararraylength = fields.length;
if(formtype == 2)
{
for(vari = 0; i < arraylength; i++)
{
vartitle = Xrm.Page.getAttribute(fields[i]).getSelectedOption().text;
alert(title);
if(title !=null)
{
if(title =="Required")
{
Xrm.Page.getControl(fields[i]).setDisabled(
true);
}
}
}
}
}