Hi,
RBO is a proxy layer to the original (and ugly array everywhere) RB module. It has some limitations, so let me correct your code.
At first you should use the field name(or label as you wish) not identifier in from(..)->fields('Field Name'). However it looks like working but I've got an issue somewhere when it was identifier - I don't remember where but believe me.
Second thing. When you'll use a Select field, then in database you'll get an id that links to the company, not the Company Name.
So your crits are not proper, because ['company_name'] field stores in fact a id number of the company.
And I suggest you to use just a "Company" as a label, because I think it's the same in meaning, but it will be a lot easier to understand a code (that "company" field is an id, not a string). But it's up to you.
$Co_Name = new RBO_Field_Select('Company Name');
$Co_Name->set_required()->set_visible();
$Co_Name->from('company')->fields('Company Name');
$fields[] = $Co_Name;
An here you should use a field identifiers... I know it may be confusing.
public function company_addon($record) {
// $record is a company data ?
$this->init_default_rb();
$defaults = array('company_name' => $record['id']); // your company name stores a id of the company
$this->rb->set_defaults($defaults);
$crits = $defaults;
$cols = array('Company Name' => true); // really you want to show this column? Under the company I would rather hide it :)
$show_data_params = array($crits, $cols);
$this->display_module($this->rb, $show_data_params, 'show_data');
}
Regards,
Adam