Question
1
Replies
2734
Views
Posted: March 14, 2018
Last activity: March 14, 2018
Closed
Between 2 date validation
Hi, is it possible to set a date validation to be 2 months before current date?
For example, today is 14 Mar 2018. I can select any date between 14 Jan 2018 to 14 Mar 2018. If I choose 12 Jan 2018, I will get a error message.
Hi,
You can modify an Edit-Validate rule of that property to achieve this behavior.
Here's the sample code, which throws a validation error if the entered Date is 60 days earlier than today's date. I have saved as 'IsFutureDate' edit validate rule into a different ruleset with a different name and written this code.
refer to these PDN links:
https://pdn.pega.com/community/pega-product-support/question/how-call-message-rule-edit-validate
https://pdn.pega.com/how-specify-error-message-text-within-java-code-edit-validate-rule/how-specify-error-message-text