Question

The 'estimatedvalue' attribute of the opportunity entity is marked as being required. I have it on the form, but have marked it as being disabled, both through the Form UI customization, as well as using javascript, but some other javascript is re-enabling the form after I've disabled it.

The best solution I have so far is disabling the attribute from the callback of a timeout: setTimeout("CommonLib.setDisabled('estimatedvalue', true);", 1);. When the field loads, it loads as disabled, then some other js is enabling the field, then the callback from the timeout runs and disables it again, so you see the field go from grayed out, to black, to grayed out.

There are two other attributes that I've disabled and they stay disabled, but the estimatedvalue is the only one that is actually required, so I'm guessing it has something to do with that.

Any ideas as to what is re-enabling the field?

Was it helpful?

Solution

I dont think it has anything to do with the requirement level but @Anwar may be one explanation. Could you double check if some other custom script might be enabling the field?

I just tried following with the task where subject is the required field and it seems to be working fine:

Xrm.Page.ui.controls.get('subject').setDisabled(true);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top