Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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 this script as a workflow transition validator to allow transition only if a date field 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;
}