-
-
Save furkankaracan/2891e12ce38ac1d8ac2c74b3f4288c2c to your computer and use it in GitHub Desktop.
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