Please wait, loading...

 

DATE VALIDATION ( GET DATE , MONTH AND YEAR FROM AN FIELD) USING JAVASCRIPT IN MSCRM 2011 , 2013

February 14, 2014
function onjoiningdate()
{
//get the value of date of joining
var startday=Xrm.Page.getAttribute(“new_joiningdate”).getValue();

var today=new Date();
var one_day=1000*60*60*24;
var one_month=30;
var one
var starttime=startday.getTime();
var currenttime=today.getTime();
//alert(starttime);
//alert(currenttime);
var difference = Math.abs(currenttime – starttime);
//alert(difference);
noofdays=Math.round(difference/one_day)
noofmonths=Math.round(noofdays/one_month);
//alert(noofdays);
//alert(noofmonths);
Xrm.Page.getAttribute(“new_loyaltyduration”).setValue(noofmonths);
}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more