Looking for information about preventing configuration save when invalid data is on form

I’ve got my fields/combobox backcolor changing to and from a pinkish red color and white when the inputs are invalid/vaild. But how do I prevent user saving when the fields are not all valid?

You can put some validation code in the OnPage leave, and reject the save. You will need to check your values one more time in that code.

I think I found it… Thanks for the direction!

1 Like

A trick I would use is to create a mandatory field but hide it. After my validation code ran, it would populate the field if all validation passed. If not, there would be an error on Save since the user would be missing a required field. I’d name it some like FixInputErrors.

Thanks for the idea, but I just created a UD Method called InValidFormData and return booean from it using the simple code:

Args.Cancel = InValidFormData(); // In OnLeave method for the Page

This allows me to add further validation if needed without doing more updates to the page itself, but just tweaking the UD Method.

4 Likes