This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EndDateValidationWithFormNotification: function (executionContext) { | |
var formContext = executionContext.getFormContext(); | |
var startDate = formContext.getAttribute("my_startdate").getValue(); | |
var endDate = formContext.getAttribute("my_enddate").getValue(); | |
if(endDate > startDate) | |
formContext.ui.clearFormNotification("EndDateValidation"); | |
else{ | |
formContext.ui.setFormNotification("End Date must be bigger than Start Date", "ERROR", "EndDateValidation"); | |
formContext.getAttribute("my_enddate").setValue(null); | |
} | |
}, | |
EndDateValidationWithIsValid: function (executionContext) { | |
var formContext = executionContext.getFormContext(); | |
var startDate = formContext.getAttribute("my_startdate").getValue(); | |
var endDate = formContext.getAttribute("my_enddate").getValue(); | |
var valid = endDate > startDate; | |
formContext.getAttribute("my_enddate").setIsValid(valid, "End Date must be bigger than Start Date"); | |
formContext.getAttribute("my_enddate").setValue(null); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment