Monday, March 28, 2016

Validate date MSCRM Javascript

function ValidateDates() {
    var Date1 = Xrm.Page.getAttribute("scheduledstart").getValue();
    var Date2 = Xrm.Page.getAttribute("scheduledend").getValue();
    if (Date1 != null && Date2 != null) {
        if (Date1.setHours(0, 0, 0, 0) < Date2.setHours(0, 0, 0, 0)) {
            alert("You must specify an end time that happens after the start time");
        }
    }
}

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...