Thank you for your request. Unfortunately, it is not possible to make the Attachment required using custom methods as it is a detail.
However, as a workaround using l development, you can implement following validation script (sample for Activities) in object process for Validating message:
As for the 'Select' errors - the most probable reason is the usage of the Terrasoft.Core.DB namespace is not added to the class.
As for the last error in your screenshot - either it will be fixed by fixing previous errors or the issue is that you call construction that requires 1 type argument. Need to see the code in this line.
Isn't there another way to make the attachment file mandatory through validation of the form page and not by placing a condition on the table in the database that I want in the form page?