[quote="ajb":1w6e36vc][quote="Krusso":1w6e36vc]tell my why, tell me why, you do not post answer to my question? Is it stupid enough for ya attention?[/quote:1w6e36vc]No it's not. Just because you can't read or you're too lazy to read :evil: Every new user's first post need to be approved and you've been informed about this. But we don't get any notifications about new user's post from existing topics - such forum engine.
Answer: use CRM_Contacts_RBO_CompanyOrContact class for field definition.
Then in addon you have to prepend 'C:' or 'P:' for company (C) contact (P like person) in the crits.
addon_contact($r) { $crits = array('your_field' => "P:" . $r['id']); ... }
addon_company($r) { $crits = array('your_field' => "C:" . $r['id']); ... }
Regards,
Adam[/quote:1w6e36vc]
Excuse my impatience, Adam. Since I'm not php genius (as you can see) I still have troubles no matter how much I read developer's tutorial. I've created custom module with all 4 files ( Products_0, ProductsCommon, ProductsInstall and Recordset) according to Hello World tutorial. It was installed and working. Fine. But when it comes to this "Select" field which should select customers from both Contact and Company I'm lost. In Recordset.php I have fields array. "Customer" field is
$Select = new RBO_Field_Select(_M('Customer'));
$Select->from ('Company')->fields('company_name')->set_visible();
$fields[] = $Select;
Everything works. You gave me hint how to set field definition, but I still do not get idea. Can You help me?