You need to create a custom microflow that does the validation checking before saving your object. This microflow will then become an alternative for the default Mendix save button.
With your custom microflow, you can perform actions such as checking in a Gateway split whether Object/Attribute != empty. If the attribute is of type string, it could be handy to also add a trim(Object/Attribute) != ''.
See also https://world.mendix.com/display/refguide5/Exclusive+Split and the other topics for more information.
Small example below: https://modelshare.mendix.com/models/6257d49e-cfd0-4463-94e1-d091b76ef71e/validation-before-commit-example