Looking for some pointers on a validation rule and the evaluation of Null fields.
Our Change Control Request (CCR) has a CABReviewDate that is only required for Medium and High risk changes. When required that date must be greater than today. This check that the CABReviewDate is greater than today should only occur when the CCR is in the Logged status. (We check this before Submission. After submission the date would be older than the current date as it works it way through the process.)
Here is the validation rule:
$(Status == "Logged" && RiskLevel in ("Medium", "High") && CABReviewDate >= CurrentDate()
|| Status == "Logged" && RiskLevel not in ("Medium", "High")
|| Status != "Logged")
- This rule fails if the Risk Level has not been calculated, as in the sql field states "null". (Risk Level is not required for a save in Logged status.)
- The rule works with the "Null" Risk Level on the first Save (creation).
- After the first save any edits cannot be saved until the Risk Level questions are answered which populates the Risk Level field (Low, Medium, High)
I tried adding:
- || Status == "Logged" && RiskLevel == null
- || Status == "Logged" && IsNull(RiskLevel)
and several other iterations which I cannot recall due to the late hour.
Any special tricks I'm missing? Most appreciative for any advice! Thanks - Mark.