Skip to main content

I'm apparently doing this wrong. I'm trying to add a validation rule on a date picker that says If Choice A is picked for control named choiceLetter,  check if the date selected is more than 120 days PREVIOUS to Current Date, and if it's true then the date is invalid. I can't even get the date rule working regardless of choiceLetter control. Is the below validation rule not correct? It seems like regardless of the date selected it fails the validation.

or(dateDiffDays({Self}, Current Date) < 120, {Self} < Current Date)‍‍

I've also tried making a calculated value of:

dateAddDays(Current Date, -120)

and then in the control properties of the date control, comparing it to the calculated value above, saying if Less than or equal, give error message but I think because I'm getting the returned value of "Sunday, April 9, 2017 12:00:00 AM" in the CV, the date picker can't validate against it. It doesn't seem to apply the validation at all in this case.


Hi ,

The below validation rule is working fine. And also i have added a calculated value which will show the difference of days count.

dateDiffDays(Current Date,ReleaseDate) > 120

206348_pastedImage_1.png206349_pastedImage_2.png

Thanks,


Yea, that's a problem. I'm trying that same string and it's not working. This is on a completely new form and list. I also tried swapping dateDate and Current Date but no change. 

dateDiffDays(dateDate,Current Date) > 120


I hope you are using named controls only in validation rule, May i know which version you are using?


if you input whatever past date your condition evaluates to true since 2nd expression evaluates to true. that's why validation dos not pass through.

if you want to check if date is older then 120 days, first expression should be enough.


that's a validation error on Title mandatory field, not on date validation...


Reply