Hi,
Insure that the field value you are getting it must exists in form weather it may be enable of disable.
Check weather the field contains any value or not.
And another thing to disabled a control you should have write
Xrm.Page.ui.controls.get("fmc_followupby").setDisabled(true);
not
Xrm.Page.ui.controls.get("fmc_followupby").getDisabled(true);
function disablecontrol() {
//get date from ms crm
if (Xrm.Page.getAttribute('followupdate').getValue() == null) return;//or else show some message to user
var date = new Date(Xrm.Page.getAttribute('followupdate').getValue());
var d1 = new Date();
date.setHours(date.getHours() + 2);
if (date < d1) {
Xrm.Page.ui.controls.get("fmc_followupby").setDisabled(true);
}
}
Regards,
Priya