I have a field that I am limiting to no more than 25 characters using the behaviors plugin. The rule works when you try to exceed 25 characters from an edit screen. However, from the view screen you can still change it to exceed 25 characters. Is it possible to fix this so that it simply cannot exceed 25 characters from any screen?
def field = getFieldByName("Use Case Product")
if ((field?.value as String)?.length() > 25) {
field.setError("Length of the field should be less than 25 chars")
} else {
field.clearError()
}