Unable to Modify OOB Extension Date Validation from Valid From to Valid To
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
17m ago
Hi GRC experts,
I have a situation with a Policy Exception record. We have a separate Extension Date field in the Schedule section of the Policy Exception record. This field is currently being validated against the Valid From field and does not accept any date that is more than 365 days after the Valid From date.
My requirement is simple: instead of validating against the Valid From date, I need the validation to be based on the Valid To date. The Extension Date should not accept any date that is more than 365 days after the Valid To date.
I found an OOB onChange Client Script called "Validate requested valid to", which is responsible for validating the Extension Date field when its value changes. Inside this Client Script, there is a UI Script called "sn_compliance.PolicyExceptionUtils" that performs the validation logic.
I changed the argument from "valid_from" to "valid_to" in the Client Script where the function from the UI Script is being called. I also updated the error message in the UI Script to:
"The duration of this policy exception cannot be more than 365 days from the Valid To date."
Previously, the error message was:
"The duration of this policy exception cannot be more than 365 days from the Valid From date."
However, I still do not see these changes reflected on the form. In fact, when I test using alert and console log statements in the UI Script, it appears that the UI Script is not being called at all.
I also observed another behavior: I continue to receive the same error message even when the UI Script is inactive. However, when I deactivate the Client Script, no validation or error message appears.
I have attached the necessary screenshots for reference. If anyone can help me understand what I might be missing, it would be greatly appreciated. Thank you.