Thursday, May 23, 2013

Find the Number of Days between two Days.



function CalculateDaysOpen()
{
        var FormType = Xrm.Page.ui.getFormType();
        if (FormType != null && FormType==2)
{
                  var currentDate=new Date();
 var createdDate=Xrm.Page.data.entity.attributes.get("createdon").getValue();
                  cycletime = Math.abs(currentDate- createdDate)
          alert(Math.round(cycletime / 86400000));
         }
}

No comments:

Post a Comment