function checkEstimatedCloseDate() {
var date = Xrm.Page.getAttribute("estimatedclosedate").getValue();
if (date != null) {
var today = new Date();
var currentDate = today.getDate().toString() + "/" + (today.getMonth() + 1).toString() + "/" + today.getFullYear().toString();
var dateWithNoTime = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
if (Xrm.Page.getAttribute("estimatedclosedate").getValue() < dateWithNoTime) {
alert("Estimated Close Date Cannot Before " + currentDate);
Xrm.Page.getAttribute("estimatedclosedate").setValue(null);
event.returnValue = false;
}
}
}
Regards Faisal