BUGFIX (SS3.1): $fieldInstance = $this->form->dataFieldByName($field);

...SS 3.1)

Fix: $fieldInstance = $this->form->fields->dataFieldByName($field);

Regards,
Jose A.