Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

how to disable the optionset field ?

$
0
0

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);

                }

            }

        }

}   

}


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>