Hello everyone ,
i need one small help in java scripts.
i have written below code in field called actual start-(this is field) in form in ms crm 365.
my requirement is ....when i open a page then actual start date should be auto field and if someone want to change date in less then current date then it should through alert message and make the field blank (actual start) while saving the form and does not let the save the form unless entered the current date or future date ...
----------------------------------------------------------------
function fromDateValidation()
{
debugger;
var fromDate = Xrm.Page.getAttribute("actualstart").getValue();
var today = new Date();
var currentDate = today.setHours(0, 0, 0, 0);
Xrm.Page.getAttribute("actualstart").setValue(currentDate);
// var currentDate = today.getDate();
// var getFromDate = new Date(fromDate);
//var frDate = getFromDate.getDate();
if(fromDate < currentDate) {
alert("Start Time cannot less than Today's date");
Xrm.Page.getAttribute("actualstart").setValue(null);
return false;
}
}
-----------------------------------------------------------
m sorry to ask this but m new to this java scripts
thanks .
AMit