pega validation

I want to apply validation for DOB field 17y < Age < 81y, how can I do that?

@sahanc38

validate rule and add it in flow action. see the screenshot for code

@sahanc38 If you want to validate based on given date of birth and not age then use a validate rule and then select expression and use below expression

@DateTimeDifference(@dateValue(.DateOfBirth),@dateValue(@today()),“Y”) and then check for the value if its less than 17 or greater than 81.

Hope this helps.

@sahanc38 oh yes I missed DOB in the question.

do as Santosh said

@DateTimeDifference(@dateValue(.DateOfBirth),@dateValue(@today()),“Y”) and then check for the value if its less than 17 or greater than 81.