Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Use+validators+based+on+date+range+-+15482456
widthauto

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 macroshowLineNumberstruetitleAllowIfDateRange.silurlhttps://bitbucket.cprime.io/projects/CAP/repos/sil-script-library/raw/Workflow_Validators/AllowIfDateRange.sil?at=refs%2Fheads%2FmastersyntaxHighlightingJavaScriptUse 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;
}