Created
July 23, 2019 15:16
-
-
Save manvillej/0da9f37ae40a4118f0ef890ae8cf2e5b to your computer and use it in GitHub Desktop.
modified Set Start and End Dates
This file contains hidden or 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
(function executeRule(current, previous /*null when async*/) { | |
if (current.end_date < current.start_date) { | |
gs.addErrorMessage('End date must be later than start date!'); | |
current.setAbortAction(true); | |
} | |
var today = new GlideDateTime((new GlideDate().getValue()) + " 23:59:59"); | |
if(today.after(new GlideDateTime(current.start_date))) { | |
gs.addErrorMessage('Start date must be after today'); | |
current.setAbortAction(true); | |
} | |
})(current, previous); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment