My Photo

Microsoft Dynamics 365

Official Blog for Microsoft Dynamics Functional and Technical Solutions....
Browsing Category " date "

CALCULATE NO OF MONTHS ( FIELD DATE - TODAY ) USING JAVASCRIPT IN MS CRM 2011 , 2013

On
/// <reference path="XrmPage-vsdoc.js" />
function calMonths() {
    //get the startdate field value in variable
    var startday = xrm.page.getAttribute( "fieldname").getValue();
    // get todays date in variable
    var today = new date();
    // get the value of one day in (mili_second * second * min * hours)
    var one_dat = 1000 * 60 * 60 * 24;
    // get no of days in month
    var one_month = 30;