Hi again. All your advices were big help for me. Now I'm struggling to put this script into my recordset
$fields = array(
...
array('name' => _M('Employees'), 'type'=>'crm_contact', 'param'=>array('field_type'=>'multiselect', 'crits'=>array('CRM_TasksCommon','employees_crits'), 'format'=>array('CRM_ContactsCommon','contact_format_no_company')), 'display_callback'=>array('CRM_TasksCommon','display_employees'), 'required'=>true, 'extra'=>false, 'visible'=>true, 'filter'=>true),
...
);
I've made like this:
$fields = array();
...
$employees = new RBO_Field_Multiselect(_M('Employees'));
$employees->from('contact')->fields('Last Name','First Name')->set_crits_callback(array(__CLASS__, 'employees_crits'));
$fields[]=$employees;
...
return $fields;
public static function employees_crits() {
return array('(company_name'=>CRM_ContactsCommon::get_main_company(),'|related_companies'=>array(CRM_ContactsCommon::get_main_company()));
}
It works somehow, but I cannot see employee info on mouse hover, so I think that something could cause problems during use of module.