[quote="ghristov":wwg8ciim]Hi jcvieira,
You should associate a QFfield callback to the field:
$field->set_QFfield_callback(array('Custom_MyModuleCommon', 'QFfield_companies'));
and add code to the callback method (placed in your Custom_MyModuleCommon in the case of this example).
Code should be similar to below:
public static function QFfield_companies(&$form, $field, $label, $mode, $default, $desc, $rb_obj){
if ($mode=='add' || $mode=='edit') {
$companies_select_list = self::get_companies_select_list();
$form->addElement('multiselect', $field, $label, $companies_select_list, array('id'=>$field));
$form->setDefaults(array($field=>$default));
}
else {
if (isset($display_callbacks[$desc['name']]))
$callback = $display_callbacks[$desc['name']];
else
$callback = array('CRM_ContactCommon','display_company');
$form->addElement('static', $field, $label, call_user_func($callback, $rb_obj->record, false, $desc));
}
}
Best regard,
Georgi[/quote:wwg8ciim]
Thanks Georgi... Its almost there with your answer but it does not store the values proprerly on the database. What field type should i use for the record browser? At the moment is putting "Array" as stored value on the db... 🙁