I've been trying to disable a date field on one of my forms using javascript.
I tried the following lines of code to try disabling the field
Xrm.Page.getControl('datefield').setDisabled(true);
Xrm.Page.ui.controls.get('datefield').setDisabled(true);
I've tried each of this with no success.
I'm still able to clear existing dates and set new ones after this code has run.
Is there another way to disable date fields?
Thanks
James F.