onBeforeSave and custom form

I’ve got the validation message working. There was some extra code that was causing some problems. Now just the onBeforeSave