diff --git a/code/Company.php b/code/Company.php index 7e832e2..f160501 100644 --- a/code/Company.php +++ b/code/Company.php @@ -29,7 +29,13 @@ class Company extends DataObject { public static $summary_fields = array('Name', 'Category', 'Revenue', 'CEO'); + function validate() { + if(!$this->Title) { + return new ValidationResult(false, 'Title is required'); + } else { + return parent::validate(); } + } public function requireDefaultRecords() {