Hello,
I got a simple class
class Contact extends DataObject {
static $db= array('Firstname'=>'varchar', 'Surname'=>'varchar');
static $has_one = array(
"Company" => "Company",
);
static $many_many = array(
"Leads" => "Lead",
);
}
Then in the Leads Admin page, when i try to link it to a contact, i got this error:
Error at framework/forms/gridfield/GridFieldAddExistingAutocompleter.php line 171: Uncaught LogicException: GridFieldAddExistingAutocompleter: No searchable fields could be found for class "Contact"
If I replace 'Firstname' with Name, I don't have problem at all. So by default, GridFieldAddExistingAutocompleter tries to use the 'Name' field to search for auto-completion, if there is no Name fields, it will fail.
I tried to put
static $searchable_fields = array('Firstname', 'Surname');
but it doesn't help.