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 23: Creating New Records Programmatically with JavaScript in Dataverse / MSCRM

In this Blog, we will see how to Create New Records Programmatically with JavaScript in Dataverse / MSCRM var record = {}; record.bosch_day...