Button handy |
---|
blank | true |
---|
color | #0052CC |
---|
name | Send Feedback |
---|
link | https://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Use+validators+based+on+date+range+-+15482456 |
---|
width | auto |
---|
|
Html bobswift |
---|
<iframe width="560" height="315" src="https://www.youtube.com/embed/cK2qPE06w_k" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe> |
Bitbucket file macro |
---|
showLineNumbers | true |
---|
title | AllowIfDateRange.sil |
---|
url | https://bitbucket.cprime.io/projects/CAP/repos/sil-script-library/raw/Workflow_Validators/AllowIfDateRange.sil?at=refs%2Fheads%2Fmaster |
---|
syntaxHighlighting | JavaScriptUse the following script as a workflow transition validator. It allows a transition only if the date field value is within 180 days from today. Code Block |
---|
interval range = "180d";
date maxDate = currentDate() + range;
string errorMsg = "Due date must be within 180 days of today";
if(isNull(due) || due > maxDate) {
return false, "error", errorMsg;
} |