Validate text field length based on record objects allowed length
"Varchar properties would usually be edited via a TextField which you can set a character limit on - would be great if this was automatically set based on the varchar length. This would prevent a lot of trimming in the CMS. Error message as a back up for other contexts would be good too."
Work at https://github.com/silverstripe/silverstripe-framework/pull/3694 has been closed for now may need reimplemented into a future version.