Script:
function CalculateAge() {
var DOB = Xrm.Page.getAttribute("vwlzs_dateofbirth").getValue();
var todadate = new Date();
if (DOB < todadate) {
if (DOB != null) {
var d = new Date();
var n = d.getFullYear();
var TotalAge = n - DOB.getFullYear();
Xrm.Page.getAttribute("vwlzs_age").setValue(parseInt(TotalAge));
}
else {
Xrm.Page.getAttribute("vwlzs_age").setValue(null);
}
}
else {
alert("No future date allow!");
}
}
CRM 2013 Javascript Calculate Age Based On Date of Birth
Posted by Unknown at 1/13/2015 02:50:00 pm
Labels: CRM 2013, Javascript
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment